Your update to iPadOS 15.7 is likely just coincidental to the issue.
Remove the Smart (folio) keyboard from your iPad - and carefully/gently clean the smart connector contacts on both the iPad and keyboard with a soft pencil eraser. Ensure that the contacts are dirt and dust free - and all debris from the eraser have been removed - before reconnecting the two.
If you can't connect your iPad to your Magic Keyboard, Smart Keyboard, or Smart Keyboard Folio - Apple Support
Given your description, you may see occasional appearance of this error >>> If you see an ‘Accessory may not be supported’ alert - Apple Support
If you are using a Smart (folio) keyboard, the alert is typical of a faulty folio keyboard. The electrical connections that pass though the flexible fabric hinges typically fracture with extended use - this usually resulting in errors and/or the on-screen notification.
A Smart folio keyboard is itself not repairable. If a fault has developed, the only remedy is replacement of the keyboard. If you are within your one-year limited warranty, you’ll need to contact Apple Support or your retailer.
You will find the Get Support link at top-right of this page.
Alternatively, you can initiate a support case using the excellent Apple Support App. If not already installed on your device, the App can be downloaded from the App Store:
https://apps.apple.com/gb/app/apple-support/id1130498044
A further alternative is to visit the Genius Bar at your local Apple Store, where the technicians will be delighted to assist. When visiting the Genius Bar, a reservation is recommended:
Genius Bar Reservation and Apple Support Options - Apple