I ran into this last year when I was trying to do the same thing (headless VNC display) and couldn't get kstars to speak. I too resorted to exporting a physical X11 display, but this was never satisfactory in my opinion.
Today I ran into the same issues with qtcreator (a programming app). The common link is QT. After a bit of digging it turns out this is a (IMO) bug in QT5 that, if XKEYBOARD extensions are not present (as they're not on the usual headless vncservers, tightvncserver in my case) it defaults to some pre-programmed keyboard mappings.
Any attempts to override them with the environment variables they check for just this purpose failed dismally.
The workaround I've found and tested is to use TigerVNC server instead which does support the XKEYBOARD extension. This, apparently, may not work with all keyboard mappings, but does seem to do the job with my UK Mac one for both qtcreator and kstars. I haven't tried it out on my Pi, but don't see why it shouldn't work if compiled from source.
Have a look, it may solve your problem without needing you to run with actual display hardware: