Someone had this issue a while back on Void Linux, although it was never reproduced or root-caused. You could check my comments in this GitHub issue  for a first diagnosis step and report the results here. Does it work in other Qt applications?
Thanks, Damien, for the relevant link (and for fixing my bugged posts, not sure why they wouldn't show).
So this issue seems to only occur on Debian for now. They introduced a security fix for ibus that triggers a race in glib, breaking the IME for some applications. Qt and Java seem to be using ibus in a similar way, so it broke for both.
Some of your options, from least to most painful:
- Downgrade/pin ibus
- Switch to another IME, e.g. fcitx
- Build glib yourself with the proposed patch and hope for the best
FWIW, I can confirm that fcitx-anthy is working with Anki on Debian bullseye, although I use fcitx-mozc as a daily driver.