Look for some code that uses “load_relationship” and use that system to first traverse the relationship, then change the field
I don’t know the answer. But does it need to be filled in the moment of conversion? Why not before, in the Lead, and then it’s just copied directly to the converted record like any other field?
You can setup XDEBUG in your web server for PHP debugging, see any online tutorial.
Get an IDE for it and start debugging properly, sometimes it is tough to set up but the gains are enormous, your productivity will be multiplied, and also the reliability of your code.
Remember you can test the return values of all those functions to see if they are returning what you expect, and not “null” or something else.