Don't treat Monsters as Monsters - they don't know their own stats!
Monsters are beings you should be roleplaying. Including Tiamat.
Tiamat doesn't know her exact HPs, nor the damage output of the PCs. She will be confident that "mere mortals" can't hurt her ... until they do.
The "Bloodied" condition (half max HP) can be the point where a blow goes from being shrugged off, to actually connecting and causing damage.
So from Tiamat's perspective, the fight consists of the PCs ineffectively throwing attacks at her as she smashes them. They, surprisingly, aren't smashed instantly - in 99.9% of Tiamat's interactions with mere mortals, each attack turns the target into a fine mist. Here, she is fighting mortals who don't evaporate.
It is concerning.
Then they bloody her. Whichever attack breaks 50% HP is akin to someone being in a bar brawl - knocking heads, dominating as usual - then suddenly they are stabbed by a knife. It isn't a deep wound, but it actually hurts and it means that the fight isn't going the way you expected.
Retreat and Regroup
Engage the PCs before they reach the "final objective", whatever it is. If they are trying to get a macguffen, fight the PCs outside the structure where it is. Have some tactical depth to the situation, and make the first engagement a bit of a "Tiamat's choice".
Then, when things go poorly (she is bloodied), Tiamat will disengage. Her speed is pretty fast, so the PCs will only get a few blows in as she leaves. Any mobility the PCs have - cloaks of the monteback, boots of speed, etc - may let them stay in range for an extra turn, but will probably cost them some offence.
Once out of range, Tiamat rapidly heals to full. She'll call in any support she has. Odds are the PCs are trying to threaten something Tiamat values (maybe a location?), so Tiamat will fall back to guard that.
The second fight kicks off against a full HP Tiamat who is now going to avoid closing in melee. At the same time, the PCs have an objective - destroy an anchor? Trash her thone? - that compels Tiamat to actually stop the PCs.
At the very least, this has increased the length of the encounter by 50%. And if you add in some harrying of the group as they advance...
She is still an arrogant god
I'd maybe lean into the multi-headed thing for roleplaying her.
- Red: Vengeance, Wrath
- White: Beastial
- Black: Sadist
- Blue: Pride
- Green: Scheming
Blue will object to treating mortals as a real threat. Black will enjoy torturing the PCs. White will probably be the one who reacts to the damage and gets her to flee, which Blue will treat as an affront. Green will try to manipulate the other heads.
Red, however, is dominant. And after the PCs "win" round 1 by bloodying her, will want to completely destroy them.
In the first fight, white gets wounded. In pain, Tiamat flees. Blue objects strongly. Red promises retribution.
In the intermediate part, Black laughs as she tortures the PC with breath weapon attacks from afar and cover. White continues to nurse her wounds. Green teases Blue.
In the second fight, they start at range, and pepper the PCs with breath weapons and the like. Blue insists they close range and kill them. White objects. Green teases Red. Red smacks White down and Tiamat charges into melee after 1-2 rounds.