It's either Sonoma casuing this. Or you have a third party app interfering.
One of these (but not limited to them)
- WebRoot
- Apple Terminal
- Word, Excel, Powerpoint
- »Enable Full Keyboard« in Settings > Accessibility > Keyboard on Mac OS
- Apple Mail, Outlook
- Spacebar is used as a shortcut by the system
- Chrome, Internet Explorer, Safari
- Wacom Desktop Center, Wacom settings
- Windows Touch Pad problem
- LastPass, Bitwarden (password managers)
- The VPN
- LangSwitcher app (it needs to be closed and disabled)