System hangs when switching inputs from keyboard to mouse using X.Org

Context: Switched from Wayland to Xorg recently due to screen sharing issues on apps like Zoom and Teams.
After around 3 or 4 hours, my system randomly freezes, and today I noticed the consistent behaviour:
If I’m moving the mouse, everything works just fine. The moment I press any character on the keyboard to input data anywhere, everything freezes for around 4 seconds. If Audio does not freeze, only video.
After that, same thing: I can’t alt + tab because that brings the mouse pointer to the foreground, but I can type as long as I want, navigate within the same app. But, the moment I move the mouse pointer, it freezes again for the same amount of time.

$ inxi -Fazy
System:                                                                                       
  Kernel: 6.6.34-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 14.1.1                                                                                                                    
    clocksource: tsc avail: hpet,acpi_pm                                                      
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-6.6-x86_64                                                                                                                                       
    root=UUID=789272d4-c6d4-45f4-888c-3f1b8d5e5d61 rw rootflags=subvol=@ quiet                
    cryptdevice=UUID=0945f6d4-da68-4ed5-8fc6-2bf02b8f7b1a:luks-0945f6d4-da68-4ed5-8fc6-2bf02b8f7b1a
    root=/dev/mapper/luks-0945f6d4-da68-4ed5-8fc6-2bf02b8f7b1a splash                                                                                                                       
    apparmor=1 security=apparmor udev.log_priority=3                                                                                                                                        
  Desktop: GNOME v: 46.2 tk: GTK v: 3.24.42 wm: gnome-shell                                   
    tools: gsd-screensaver-proxy dm: GDM v: 46.2 Distro: Manjaro base: Arch Linux             
Machine:                                                                                      
  Type: Desktop System: Gigabyte product: B550M AORUS ELITE v: N/A                            
    serial: <superuser required>                                                              
  Mobo: Gigabyte model: B550M AORUS ELITE v: x.x serial: <superuser required>                 
    uuid: <superuser required> UEFI: American Megatrends LLC. v: F19                                                                                                                        
    date: 03/22/2024                                                                          
Battery:                                                                                      
  ID-1: hidpp_battery_2 charge: 31% condition: N/A volts: 3.8 min: N/A   
    model: Logitech G703 LIGHTSPEED Wireless Gaming Mouse w/ HERO type: N/A      
    serial: <filter> status: discharging                                                      
CPU:                                                                                          
  Info: model: AMD Ryzen 9 5900X bits: 64 type: MT MCP arch: Zen 3+ gen: 4                    
    level: v3 note: check built: 2022 process: TSMC n6 (7nm) family: 0x19 (25)                
    model-id: 0x21 (33) stepping: 2 microcode: 0xA20120E                    
  Topology: cpus: 1x cores: 12 tpc: 2 threads: 24 smt: enabled cache:                         
    L1: 768 KiB desc: d-12x32 KiB; i-12x32 KiB L2: 6 MiB desc: 12x512 KiB                     
    L3: 64 MiB desc: 2x32 MiB                                                                 
  Speed (MHz): avg: 3634 high: 3693 min/max: N/A cores: 1: 3586 2: 3405                       
    3: 3693 4: 3693 5: 3580 6: 3693 7: 3693 8: 3693 9: 3693 10: 3693 11: 3693                 
    12: 3693 13: 2997 14: 3693 15: 3693 16: 3693 17: 3592 18: 3693 19: 3591                   
    20: 3693 21: 3693 22: 3693 23: 3693 24: 3693 bogomips: 177359                             
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm                    
  Vulnerabilities:                                                                            
  Type: gather_data_sampling status: Not affected                              
  Type: itlb_multihit status: Not affected                                                    
  Type: l1tf status: Not affected                                                             
  Type: mds status: Not affected                                                              
  Type: meltdown status: Not affected                                                         
  Type: mmio_stale_data status: Not affected                                                  
  Type: reg_file_data_sampling status: Not affected               
  Type: retbleed status: Not affected                                                         
  Type: spec_rstack_overflow mitigation: Safe RET                                             
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via                   
    prctl                                                                                     
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer                    
    sanitization                                                                              
  Type: spectre_v2 mitigation: Retpolines; IBPB: conditional; IBRS_FW;                        
    STIBP: always-on; RSB filling; PBRSB-eIBRS: Not affected; BHI: Not                        
    affected                                                                                  
  Type: srbds status: Not affected                                                            
  Type: tsx_async_abort status: Not affected                                                  
Graphics:                                                                                     
  Device-1: AMD Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT]                     
    vendor: Micro-Star MSI driver: amdgpu v: kernel arch: RDNA-2 code: Navi-2x
    process: TSMC n7 (7nm) built: 2020-22 pcie: gen: 4 speed: 16 GT/s lanes: 16               
    ports: active: HDMI-A-1 empty: DP-1,DP-2,DP-3 bus-ID: 09:00.0                             
    chip-ID: 1002:73df class-ID: 0300                                                         
  Device-2: Logitech C922 Pro Stream Webcam driver: snd-usb-audio,uvcvideo                    
    type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 3-4.3.2:39                  
    chip-ID: 046d:085c class-ID: 0102 serial: <filter>                                        
  Display: x11 server: X.org v: 1.21.1.13 with: Xwayland v: 24.1.0                            
    compositor: gnome-shell driver: X: loaded: amdgpu                         
    unloaded: modesetting,radeon alternate: fbdev,vesa dri: radeonsi                          
    gpu: amdgpu display-ID: :0 note: <missing: xdpyinfo/xrandr>                
  Monitor-1: HDMI-A-1 model: LG (GoldStar) TV SSCR2 serial: <filter>           
    built: 2021 res: 3840x2160 dpi: 61 gamma: 1.2 size: 1600x900mm (62.99x35.43")             
    diag: 1836mm (72.3") ratio: 16:9 modes: max: 3840x2160 min: 720x400
  API: EGL v: 1.5 hw: drv: amd radeonsi platforms: device: 0 drv: radeonsi
    device: 1 drv: swrast surfaceless: drv: radeonsi x11: drv: radeonsi
    inactive: gbm,wayland                                                                     
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 24.1.1-manjaro1.1
    glx-v: 1.4 direct-render: yes renderer: AMD Radeon RX 6700 XT (radeonsi
    navi22 LLVM 17.0.6 DRM 3.54 6.6.34-1-MANJARO) device-ID: 1002:73df
    memory: 11.72 GiB unified: no

When I move the mouse after using the keyboard, the following message appears on journalctl

jul 17 10:20:31 william-desktop /usr/lib/gdm-x-session[2185]: (II) event21 - Logitech G703 LS: SYN_DROPPED event - some input events have been lost.

Same thing the other way around

jul 17 10:21:29 william-desktop /usr/lib/gdm-x-session[2185]: (II) event2  - Razer Razer Huntsman Tournament Edition: SYN_DROPPED event - some input events have been lost.

Typically, I have a picture-in-picture video open in firefox. That may be connected.

The only thing that currently works is logging out. But, after a while, it starts happening again.