For some reason I care about this...
I found three other Twins games this year in which the starter did not go 5 but left while leading.
One was a Twins home game. Perez followed Pineda in an early season game. Perez gave up the only 3 runs the Twins allowed and was awarded the win. Harper pitched a scoreless inning but I guess was somehow determined less effective than Perez. Pineda was the most effective pitcher this day but the scorer couldn’t choose him.
In an away game Hildenberger pitched 1/3 of an inning to finish the fifth for Gibson. He was awarded the win for his 1/3 inning. May pitched a scoreless full inning but I guess was deemed less effective than Hildenberger.
In an away game Duffey finished the fifth for Berrios and had a clean 6th inning. This was the game that Austin Adams blew hitters away for 2 innings striking out 4 though he must have been less effective than Duffey who was credited with the win.
In every case the reliever completing the 5th inning was awarded the win. In each of these cases I think there is a lot clearer argument that another pitcher was more effective.
Thorpe and Duffey were critical to yesterday’s win. Unless it is so clear that Thorpe was much more effective Duffey should have had that win.
In your first example, Pineda started and pitched 4 innings. By rule, can't get the win. Perez came in in the 5th, and pitched 3.2 innings. Hildenberger and Harper combined for 1.1 innings to close a 9-3 win. Pretty easy to say Perez should get the win, he pitched the bulk of the relief effort.
In the second example, Gibson was removed with 2 outs in the 5th, with a 6-3 lead, but had just walked two hitters to load the bases. Hildenberger got the final out in the 5th, preserving the 6-3 lead. Nobody else pitched more than an inning in a game that went to the 9th with the Twins leading 14-4. I'd say Hildenberger probably was the "most effective," and certainly had the highest leverage.
In your third example, the Twins were up 15-0 in the bottom of the5th, when Berrios gave up four runs, and left with 2 on and 2 out. Duffy came on, suffered through dropped foul pop that should have ended the inning, but got the K. He then pitched a scoreless 6th, again surviving an error, with 2 more K's. Harper later pitched an inning, and Adams the final two innings of a game that ended 18-4. Hard to argue that Duffey wasn't the "most effective."