Apple Pencil disconnects right after connecting to the ipad
My Apple Pencil cannot be properly connected to my iPad. (I am using 9th gen iPad and gen1 Apple Pencil, IPadOS 15.3.1) when I plug my Apple Pencil into the thunder bolt port the pop up for pairing with the Pencil will appear, I click pair (if I don’t the pop up will disappear after approximately 4 seconds) after I click pair I check my Bluetooth section and sometimes it’s completely empty and sometimes the Apple Pencil will be “not connected”. If I press on the Apple Pencil to connect it it will say something to the lines of “make sure your accessory is turned on and in range” which I have made sure of (because it is plugged into the iPad). Then if I go to general>about I can see the Apple Pencil appearing and disappearing (Apple Pencil is still plugged into the iPad) repeatedly until I remove it from the iPad. I’ve made sure that it is not the thunderbolt port problem because my iPad can charge just fine. Is there a solution to this or is there a problem with my Apple Pencil?
iPad, iPadOS 15