Ah, sorry - misunderstood - is there any problem to set a new WLan password without using the 1-9 keys and try then? Maybe by using the web interface of your Wifi router?
Your description might indicate that the battery is swelling up and that impacts the function of the keyboard. If the physical key strokes are not reliably registered, there is probably not really much you can do.
You can check wether the problem is restricted to your current user account by creating a new one and login as this user.
You can start your Mac in
safe mode and check.
Last you can try to see wether issuing
sudo tccutil reset Accessibility
in the terminal improves the situation - but this is basically an add-on to
my earlier comment to turn off Mouse Keys.