Of course, this was done with the help of ChatGPT, but maybe it helps someone, as I have encountered people with this problem. Also one of my Lancehead Wireless was purchased on Ebay as not being able to pair. It works now.
https://github.com/dadach-ai/razer-lancehead-2017-pairing-fix
