I'm using Ubuntu 24.04.3. For me, the issue was related to the snap installation of VS Code. I removed the snap version and reinstalled it using the apt package manager, which solved the problem.
snap
apt