Read Lemon socialism (Wikipedia)

Lemon socialism is a pejorative term for a form of government intervention in which government subsidies go to weak or failing firms (lemons; see Lemon law), with the effective result that the government (and thus the taxpayer) absorbs part or all of the recipient's losses. The term derives from the conception that in socialism the government may nationalize a company's profits while leaving the company to pay its own losses, while in lemon socialism the company is allowed to keep its profits but its losses are shifted to the taxpayer.

Mark J. Green coined the exact phrase in a 1974 article discussing the utility company Con Ed.

Read Privatizing profits and socializing losses (Investopedia)
Privatizing profits and socializing losses refers to the practice of treating company earnings as the rightful property of shareholders, while losses are treated as a responsibility that society must shoulder. In other words, the profitability of corporations are strictly for the benefit of their shareholders. But when the companies fail, the fallout—the losses and recovery—are the responsibility of the general public. Popular examples of this include taxpayer-funded subsidies or bailouts.