My camera and flashlight are glitching

So i bought this iphone 12 pro with a cracked screen and back glass , but after replacing both i noticed some strange behavior, te gyroscope and accelerometer stopped working, as well as the flashlight which i tried replacing, but still didn’t work, when i opened the camera app it was very glitchy and i could only smoothly switch the camera lans on panorama mode , could this be a motherboard issue?

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

crwdns2934109:0crwdne2934109:0

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