How to change $license->product_id?
I'm not sure there is an easy answer to this right now. Product IDs are updated on licenses when a line item is created or updated. This happens in commerce_license_commerce_line_item_presave().

This gets complicated if you're using Commerce License Billing because your order renews according to your billing arrangement. If you are using that, then you'll need to review the code in there and figure out a way to save a new order that will be the one that gets renewed.

Otherwise, you could just create a new order, set the correct product, revoke the old license, and then complete the new order and then a user will have a new license and the old one will be gone.

If you have more questions, the issue queue is probably the best place to get help and provide feedback.