One expression that may be relevant is "setting fire to [something] just so you can put it out." A concrete example of this expression appears in "Setting Fire Okeh; Putting It Out ...?" in the [Salt Lake City, Utah] Deseret News (August 24, 1945):
LOS ANGELES —(AP)—The federal grand jury returned an indictment today charging that Ossie Gordon Wynns, 24, a Tulare, Calif., forestry service fire guard, deliberately set a disastrous forest fire just to show that he could put it out.
Instead, the fire got out of hand and burned over 1300 acres of Sequoia National Park forest land, the indictment charged.
Supposedly, in the bad old days of the mid-20th century, traveling vacuum-cleaner salesman used a similar tactic, unexpectedly throwing a handful of dirt on a homeowner's carpet so that they could then demonstrate how effectively the machine they were selling could clean up the mess. That might be described as "throwing dirt on the carpet so you can vacuum it up."