In the latter case, it seems like the Ming are going to be teetering on the edge of collapse at best. That kind of bad leadership creates more problems than can be solved by a few victories against the Manchus.
In the first case, just how many minutes does that anti-Qing alliance last after the Manchus are defeated? China was already falling apart at that point, no?
The Ming were weak but possessed considerable legitimacy. There were only two major rebel leaders in China in 1644 when the Manchus crossed into the mainland: Li Zicheng and Zhang Xianzhong. In May when Li Zicheng took Beijing, his territory had been limited to Shaanxi, Shanxi, parts of Henan, and what is now Hebei. Zhang Xianzhong was more in the Hubei and Hunan area. While the Ming soon lost control of Sichuan, they maintained areas such as Shandong, Guangdong, Fujian, and Yunnan until the Qing conquest. Even in the areas that the Ming lost, the situation usually consisted of the areas staying nominally Ming until rebel leaders came in, at which point local officials would switch sides. but if those rebels left the area, those same officials would declare for the Ming again. Outside of Li and Zhang, few areas spontaneously declared revolt and threw out the Ming. The Ming collapse was more of a North China thing, and not a total loss spread evenly through the empire.
The Ming loss in 1644 might be still able to keep out the Manchus if Li Zicheng wins against the Manchus, declares his dynasty, and consolidates his Shun in the north while the Ming maintain their control of the south if they can avoid infighting. It's true that Li Zicheng is basically a bandit, but if he gets on good terms with Wu Sangui, I think Li will soon get used to the learning curve and establish a decent state. Wu was an important and talented general who helped the Qing conquer China. Under Shun command, I think he'll be able to keep the Qing out of China. Remember that in 1644, the Qing would have been outnumbered by Li and Wu's combined forces. They have an army more professional than Li's, but they're working from a much smaller population base and they can't bounce back quickly if they did lose.
Overall, I think it's hard to keep the Qing out of China Proper. I think there's a chance, as I elaborated, but the events that occurred in OTL were probably the events that were most likely to occur anyways.