Weird.
So it's perfectly acceptable for the DM to...whenever they feel like it...force an encounter on the PCs despite whatever choices the PCs make...but it's totally unacceptable to end an encounter whenever the DM feels like it despite whatever choices the PCs make and the dice determine.
This is somehow bad. If the fight ends whenever the DM feels like it, regardless of the dice, then why bother rolling dice? The dice don't matter, the DM will just decide.
But this is somehow good. If the fight happens whenever the DM feels like it, regardless of the PCs' choices, then why bother making choices? The players' choices don't matter, the DM will just decide.
I can only assume that you think the random element of the dice is somehow a more valid and untouchable thing than the players choices. That doesn't make sense to me. The players are other people with preferences and minds. The dice are inanimate objects, not the gods of fate. The players and their choices should be respected. The dice are inanimate objects.