I found what was causing the issue for me on Bazzite. I had a keybind to change keyboard layout set to alt+shift (by default), and it prevented that keybind from being used anywhere else.
The keybind does not reside in the normal keyboard settings, instead you have to find it in gnome-tweaks (in my case it the app that launched gnome-tweaks was called "extra settings").
In there, go to "keyboard" -> "additional layout options".
There will be a setting "Switching to another layout", and if it is modified, it will be shown in bold. You have to unset it or set to a different keybind to make alt+shift work in other apps like VSCode. If you unset it, the default layout switch keys in linux is alt+space.
Unfortunately I don't think there is a way to both have layout switching and VSCode use alt+shift at the same time.
For screenshots of where to find this setting take a look at this - https://askubuntu.com/a/967493. My system is not on english so my screenshots would be confusing.