Doing what I’m about to say you may need to get new screws once done. I’ve had an issue at work with striped Penelope screws on iPhones ( because people use wrong/crap screw drivers) and with no other way, I took a “one time” use Penelope screw driver so if need be could throw it away and put some adhesive bonder or maybe could use superglue and dap a tiny amount on screwdriver, let sit in place on stripped screw once harden you should be able to unscrew it out. Since I used a type of adhesive bonder there is a DeBonder to get the screw driver and screw apart. Sorry for the long reply. Hope works out for you mate.
Hello, you may need to take apart the Apple keyboard and clean it, while making sure no liquid has entered in on anything. I’ve had the same issue with a razor gaming keyboard and it ended up having some Debris in it, that made two keys off set. Once cleaned it’s worked great!
Looks like to me you may need to either find a way to pop open the piece so you can “Try” to re-solder the wire together. Or lay them headphones to rest and swipe a new pair for the effort you’d have to take fixing if it even worked.