Hmmmm. This seems to be a different issue to one I have isolated as a ‘bug’. For me, any time I have to log in to a wifi connection, whether the keyboard is attached to my IPad 10.5 or not, the keyboard, as you have noted, becomes disabled from input. I don’t believe that I have had it stop other than in the instance I have noted.
Have you noted this occurring with any other specific (non-random) action? (What app are you using at the time? Does it always occur with this or any specific app? Are you on a WiFi connection that drops you after a period of time when not in use, then re-connects when you return to its use through an auto-connect?)
Have you tried removing the keyboard, wiping the connectors on the keyboard lip and the iPad edge with a clean cloth to see if it is a connection issue?
Have you been in to an Apple Store to connect with a store ‘Genius’ or discussed it with Apple Support?
...J