He has done this move before with Tesla buying Solar City. When you do a deal with yourself you can assign any value you want to assets, it isn’t a competitive process. In the previous case Solar City was dying but its acquisition by Tesla was pitched as a great synergy.
https://www.businessinsider.com/solarcity-tesla-energy-belea...
There were a few lawsuits from Tesla shareholders about the acquisition regarding self dealing but they didn’t succeed:
https://en.wikipedia.org/wiki/SolarCity