This started after I ran some updates today, basically calling
sudo apt update
sudo apt upgrade
The problem is that when I'm on Xorg, once I try to change the language, either by keyboard shortcut (With my keyboard it is the window key and space), or from the top right corner with my mouse, the system crashes (the mouse keeps moving and apparently is clicking on things because I was able to pause and play a YouTube video, but other than that, it's pretty unresponsive), and I noticed that the scroll lock light starts flashing (For me it used to light up when I change to any language other than English). However, the caps lock key does not flash and is responsive during the crash (so maybe not Kernel panic). It feels like it's stuck on a loop trying to change languages or something.
Wayland doesn't have this problem, but has other problems with languages, for example even when I change the language to a non-Latin one, it still types in the Latin alphabet on certain apps (e.g. Chrome).
I am not sure how to debug this further, and every time it crashes, I have to restart into Wayland first, then restart again into Xorg, if I restart and go to Xorg again I just get a black screen and flashing scroll lock light.
I am using Fcitx4
input method system because it was the only one working with Japanese properly on Xorg. I have English, Arabic, German, and Japanese as keyboard languages.
I am on Ubuntu 22.04.2 LTS 64 bit and GNOME version 42 and Fcitx4 version 4.2.9.8