Hey there Bob Burns,
If your Smart Keyboard is from a gen 1 iPad Pro, chances are good that it's not the iOS but what I'm 99% certain is a design flaw.
I've gone through 2 of these keyboards and I've noticed a difference in the third one which makes me believe made a slight design change on this version before moving on to the new design found in the lates iPad Pro version.
In Get one, there is the 3 gold pin contacts that meet with the spine of the iPad and magnetically connects to the 3 gold contacts on the device.
If you take the flexible spine of the Smart Keyboard you can almost feel and if you look hard enough almost see what I believe is an electronic ribbon, much like you'd see on old spinning internal hard drives or ribbons that connect tiny logic boards to LCD's.
After enough flexing, they break making the contacts on the keyboard useless.
In this lates version for iPad Pro Gen 1, I can't feel that ribbon or see the impression anymore, which makes me think something changed here.
Moving to the new iPad Pro you will notice the connector are no longer on the spine of the device but on the back of the device and the connectors on the Smart Keyboard seem to be in a more stable place.
I stumbled across news that had a program available for you to exchange your troubled keyboard, even out of warranty, with a valid serial number, which can be impossible to see if you don't take pics right out of the box. It gets lost in the material over time. See my other posting on this matter or a workaround for identifying a hard to read serial number on a velvet backing.
I would see about exchange it asap, as this program may not be offered much longer, it at all anymore.
All the best!
MJW