I pushed this commit:
https://salsa.debian.org/input-method-team/im-config/-/commit/47941de4
So, Vincent, this bug report has resulted in a tiny improvement at least. ;)
As regards the main topic I don't think it's really an im-config
specific issue. im-config is run as an Xsession script, and possibly
your setup with fvwm and an xkbcomp call in ~/.xsession is a rather
special combo where things happen in the wrong order. Fortunately you
were able to figure out the sleep() workaround.
Keeping the bug open for now to see if more users experience the same issue.
Rgds,
Gunnar Hjalmarsson