wii classic controller only works when removed from shell

Hello, recently I bought a used Wii classic (pro) controller for my Wii, it worked fine until yesterday when the controller stopped working, I opened the controller and saw that there were no wires connected, tested the buttons, d pad, triggers, and analog sticks and all of them worked, but when I put the controller back on the shell it started to act weird and it stopped working after that, I tried reopening and putting it back but same the thing happens

crwdns2934089:0crwdne2934089:0 crwdns2934093:0crwdne2934093:0

crwdns2934109:0crwdne2934109:0

crwdns2889612:0crwdne2889612:0 0
crwdns2934285:0crwdne2934285:0