By now, @RomanesEuntDomus and the other players have probably figured out that the BBEG will do that.
We knew before and prepared accordingly.
The attack happened in the dead of night, when we knew the guy was asleep, snuck into his lair and opened the combat literally with waking him up via an AoE damage and snare spell that filled the entire room.
I was barely able to get involved in the fight, once it went into melee, cause I was the target of DnD's patented bullshit "make a dumpstat saving-throw or become useless for at least an entire round"-abilities a few times.
We did everything we could as smartly as we could and the BBEG taunted us and poofed out of the room nonetheless cause we couldn't actually stop him from doing that. This wasn't a case of poor performance by the group, it was an instance of a DM making two poor decisions:
1) The DM should have set up the situation in such a way that it is a satisfying victory, even when the BBEG escapes. Like, we rescue a dungeon full of kids and virgins about to be sacrificed in the morning or taking away an important, irreplacable stronghold/set of equippement/bunch of servants. The BBEG is very good at charming people and putting them under his control, so even if he lost a neat little dwelling, all he has to do is look for another sugar-daddy to charm and then set up shop in his basement for whatever the fuck it is he does.
2) Making it look like the BBEG was (at best) mildly amused by our efforts to stop him and thus making it look like we weren't even a mild inconvenience to him. What better way to undermine the group's efforts than to make them feel like their hard fought battle was essentially just a ding-dong-ditch to the BBEG. I assume the DM wants to make that guy look cool and reserved, dominant. Like some sophisticated Bond villain, that never loses his calm and always has some awesome line on his lips about how strong he is. Too bad it has the opposite effect here and makes the group feel stupid for wasting their time on even trying to stop him.
Result: Next time BBEG raises his ugly mug, I'm going to ignore him and his shenanigans, unless there is a quest and a
very large bag of money involved. Maybe I'll ignore him even then.
Frankly, I don't even know if it would feel satisfactory to kill this clown now, since it might not even feel earned then, if you know what I mean. Like, we as a group won't have done anything to earn killing him, it'll just be the next stop on the railroad for the BBEG to go into the forever box. The suspension of disbelief is severely cracked in my case.
I would recommend (if DM allows) for him and the other players to "pass notes" about strategy for the next encounter to thwart any potential getaway. For someone going into a fight with the BBEG or a BBEG for the first time, it might serve them well to engage in info-gathering about their target. Outthink the DM. Coordinate with other players via notes if allowed.
The ironic thing is that you don't need this with a DM that would allow it and act accordingly. A DM that you have to "outthink", where you actually play against him, will just do whatever he wants. when he really wants to.
If the DM really wants his BBEG to escape, he won't be stopped by a smart strategy, as long as fudging numbers is enough to overcome that.