Open the Scintilla test app or a Scintilla-based application. Open the system settings dialog, and search for "full keyboard access". Enable it. Full keyboard access navigation keys such as the spacebar and tab key don't enter characters within a Scintilla view when full keyboard access is enabled. If you switch to an application like TextEdit, you'll see that those keys do behave properly within a text view. In researching the problem, I found https://stackoverflow.com/questions/75675226/how-to-receive-space-tab-keydown-event-when-new-full-keyboard-access-setting-i.
This is caused by implementing the NSAccessibility APIs that use keys like space and tab for navigation. This was implemented back in 2016 and getting voice-over to work was the main focus. "Full Keyboard Access" seems to be a newer mode that doesn't appear to be available on earlier macOS versions like 11.
ScintillaView doesn't implement all the text element methods (accessibilityPlaceholderValue is missing, for example), but I can't see anything about requesting access to keys. Scintilla specifies NSAccessibilityTextAreaRole and there may be a better choice of role and sub-role.
Space and tab now have two purposes - moving between elements and inserting characters. How do you decide which action is performed?
With voice-over I think it required moving 'focus' another level down so that you could edit then you canceled and moved up the hierarchy to switch between elements.
There is a "Pass-Through Mode" for Full Keyboard Access that turns off interpretation of space and tab temporarily so they can be entered. Default key: control+option+command+P.
The special treatment of space can be moved to another key like option+space with the Full Keyboard Access options panel: (i) button next to on/off toggle. However, Tab isn't so easy since it is used in chords like Tab+M (context menu) as well as isolated.
TextEdit has a very simple view hierarchy so doesn't need navigation much. control+tab puts it in navigation mode to reach the traffic light buttons on the window frame.