Bug with event SDL_JOYDEVICEREMOVED

So I’ve got this controller. I plug it in - it’s recognized not to be a gamecontroller. Comes in with device ID 0.

I remove it. the number in event.jdevice.which is again 0, and the joypad is not regarded as a gamecontroller.

so far so good.

I plug it in again - event.jdevice.which returns 0. SDL_IsGameController returns false. All good.

I remove it again.

event.jdevice.which is 1 and SDL_IsGameController returns true.

I can’t make any sense of this. Any chance it’s a bug in the API?