This issue is not specific for CAPS Lock only, but for any change on input source. The issue in the upstream has been reported: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8738 and either downgrade to 49.0 has been suggested, or revert introduced changes: https://gitlab.gnome.org/skeller/gnome-shell/-/commit/d6123a003afc9665e7b0067a46dc93b19ea52c07
The second case sounds simpler, thought I'm not the maintainer, but we need this fix, as GNOME becomes unusable by people who use more than 1 layout. Andrii

