This issue was addressed with improved state management. This issue is fixed in macOS Sonoma 14.2. Secure text fields may be displayed via the Accessibility Keyboard when using a physical keyboard.
https://support.apple.com/kb/HT214036
https://support.apple.com/en-us/HT214036