Could the battery level or whether it is plugged in have anything to do with this?
I have been having this issue on and off for a month or more. At first the keyboard was still working, so I didn’t understand what the “device not supported” message was even for; I thought maybe it was related to one of the crappy OS upgrades or else had to do with my Apple Pencil, which still works properly so far.
The first however many times the keyboard stopped working while connected, I didn’t get ANY error messages. I just reseated the keyboard after clearing any potential dust from the contacts on both kbd and ipad. Slowly the problem has built to where the keyboard isn’t working at all when I go to use it and the message comes up often.
Today, it stopped working completely for the first time and nothing I tried made a difference. Cleaning everything, reseating it carefully a bunch of different ways, coming here and doing research, trying the magnet-over-1-and-2-keys methods and more recommended above (thank you everyone for sharing), rebooting the ipad twice, nothing. Once or twice I could see it WAS briefly working when I connected it, then the error popped up and it stopped working.
I noticed my battery (which has seemed poor since receiving a replacement ipad under warranty with the promise it had a new battery) was low, around 25%, so I plugged it in during a reboot. Now the keyboard is working again! So far, everying works properly.
Except, of course, for this Apple support site. :-/ I am using the keyboard now, IN Safari, and it is doing weird crap like the arrow keys don’t move me through this text I am typing but instead jump me to other replies people have made. <SIGH>.
Anyhow, I thought I would mention that plugging it in seemed to fix the problem, this time, for me. Or else it is a random fluke with everything else I tried and has nothing to do with anything. :-D Either way, I have not been very happy overall with this allegedly Smart but not bluetooth official expensive weird keyboard and I am bummed Apple can’t afford to stand behind their products better when they have more than a quarter trillion dollars in the bank.