Can you investigate what commit fixed your issue?
Maybe 7085fecf53d9506b1f626e3cab1dd90e33aa9ed0?
Sorry for the late reply. I had health problems and am still not back to normal. I tried the commits below and the behaviour wasn't any different:
7085fecf53d9506b1f626e3cab1dd90e33aa9ed0
67a4c8b5ad9ebfb3fa2c7fae433aa6b6b5e92154
486e77befd2ea7fd750b1f24eb5dfaf2b91d70b3
66a36f1e5a323aed3d39db1044a1b71373123832
 I sadly do not have the time to any more testing than this.

And maybe something interesting: It only works when `(pgtk-use-im-context nil)` is called during startup in init.el or similar. When evaluating it by hand within Emacs fcitx stops working.