I am the Director of Technology for a private school. We have 54 iPad Pro 12.9" iPads with Smart Keyboards deployed. We gave them out in February of 2016. By the end of the school year (May 2016), we had 4 or 5 students who were getting the "This accessory is not supported by this device" message. Sometimes a hard restart did the trick. Often times, it did not.
We did find that swapping keyboards, many times, would work. What I mean is, two students would come in with the message. We would swap the two keyboards and the message would go away on both iPads.
Sometimes, that did not work and we had to swap them a brand new keyboard.
Fast forward to this school year we have had 12 smart keyboard issues. We found that many of the keyboards that were giving the "This accessory is not supported by this device" message finally stopped working on ay iPad. I currently have 7 smart keyboards that no longer work. I had another student come in this afternoon with the "This accessory is not supported by this device" message.
I really do not think it is software related. I think it is hardware related, probably related to the Smart Connector.
I am in the midst of contacting Apple to see how to deal with the issue.