Hi all,
Just to save you all some trouble, you will not be able to resolve this issue nor will Apple support I believe its a fundamental software even potentially an iPad hardware issue, I have an M4 13 inch iPad with magic keyboard started by factory resetting the iPad the problem persisted. I then carried out a fresh software install via my Mac as instructed by Apple Senior Support.
After many weeks of back-and-forth with various members of the senior support team, some helpful some very misleading. It was agreed that a keyboard replacement was required. Upon getting the replacement I was able to re-create the keyboard issue, which basically for me freezes apps at random, so both keyboard and screen touch have no effect yet the touch screen will allow app switching, the only way to fix them is to come out of the app switcher kill the app and go back in and the app could function for an hour or go do the same thing in 20 minutes. Again, back to the senior team and with a lot of trouble, I convinced them to take a look at my iPad at this stage I wanted a refund I was advised that the iPad being sent in as a repair would most likely be replaced as they are hard to repair in general what they did in fact do was to try and re-create the issue on their side which they could not and sent the iPad back, which was very frustrating. Again after a number of weeks of back-and-forth, they decided to replace my iPad within hours of receiving the new device I could still re-create the issue, which I found very strange considering I was using a completely new set up now setup as a new iPad with no backups and a new magic keyboard.
The only thing I can confirm through extensive testing is that the iPad being used as an iPad, touch screen only, does not exhibit the same problems it is only when the Magic keyboard is introduced to the set up that the problem arises. Senior support offered me a refund for the keyboard however, I had to test another keyboard, so effectively three magic keyboards in order to be eligible for the refund so I tested two separate iPads and three magic keyboards and the issue was not fixed on any device. I hope this helps and saves people some time as this has taken me almost 2 months to resolve. Apple is in the process of giving me a refund and even that is taking a lot of time. I get the impression this is a well know issue just not widespread enough for a recall and there was no mention of a software fix anytime soon. It is a real shame because I really liked using the iPad with the keyboard and it has put me off the iPad Pro range in the future and the not so good support experience.