I recently had a similar problem where the keys wouldn’t work at startup so I could not log in with that keyboard but worked ok when booted. The setting of Mouse Keys are in different places and seem to be for different purposes ie startup and normal running.
So your solution might be mouse keys after all as I indicate below.
I came across this Apple post: 7 8 9 u i o j k l m Keys not working - NO… - Apple Community which was applicable to Ventura though I am using Sequoia/M1
In part says:
I had been originally looking under system settings>>accessibility>>pointer control and thats where
mouse keys was turned off and not active, making me think it wasn't enabled.
There is a second mouse keys option under, system settings>>Lock Screen>>accessibility options that affects
solely the login screen.
This was turned on, turned it off, and problem solved!
Having read this Apple post I went to System Settings/Locked Screen/ Accessibility Options
The Mouse Keys et al were not selected.
Selected 'Mouse Keys',
Rebooted then turned off 'Mouse keys' in System Settings/Locked Screen/ Accessibility
It has worked ok ever since.