This is a known issue.
To avoid this when creating a new label, go to Audacity > Preferences > Tracks Behaviors and check “Use dialog for the name of a new label”.
When editing a label:
- click in the label
- type the first character
- click in the label again
You should now be able to edit the label normally.
Or you could right-click in the label and choose “Edit label”.
The problem is that the label (in fact, the entire project window) is losing keyboard focus, so when you type a character that is also a command (such as space-bar to play, “r” to record) the command is executed instead of the character being typed.
See also: https://forum.audacityteam.org/t/misbehaving-on-ventura/65879/1
– Bill