I’ve changed
input_libretro_device_p1 = “5”
to
input_libretro_device_p1 = “RETRO_DEVICE_ANALOG”
(the expression is from libretro.h)
and the error won’t show up anymore!
Sadly, the behaviour is unchanged; certain games won’t take any input from the controller.