Here's my take. Error 9 can be indicative of a lot of things, but it ultimately it comes down to device connection dropping. iPad Rehab made a hugely informative video about this if you really want to get into the weeds of what Error 9 ultimately means, and how to find more details when it comes to error code, but it's quite long.
Based on the symptoms you're giving, I'm thinking it could be related to a few things. It sounds like you already checked the dock flex, which was my first thought. My other thought is during disconnection of the display, the little transistors that assist in transmission of battery "gas gauge" data were nudged. This would cause the battery to be unable to send data about its level of charge to other board components and can cause weird power on types of behavior. I would peel up the little foam sticker around the display connector and check along the left edge for any signs that things were disturbed.
Definitely add some pictures. It can help us to determine the issue with more certainty.
I will also throw in the Troubleshooting Problems After A Repair wiki just for reminders on things like this. In particular the "retrace your steps" part is tremendously important in my opinion.