Hi Hutsepotmetworst,
you handled the situation in an exemplary manner
. You could have prepared a ready set validation package for coming home but as she was dysregulated maybe the best you could do is not getting drawn into a fight. It is a sensible boundary you have protecting the continuity for your D but of course gf sees it differently. Her problem.
Where you failed and noticed you failed is on dealing with your own emotions. Dealing with a dysregulated person even it you "only" get silent treatment is no fun. It sucks. Wanting to stay internally happy is understandable but unrealistic. It is in some sense even self invalidating.
It is ok. to get a bit upset about having to deal with that nonsense. It is ok to feel a bit odd after seeing the Ex and interacting as a team with her. There were huge tensions you were exposed to during the late evening.
How can I handle the sleeplessness better ? Is mindfulness a solution ? Do I have to bother other people to vent my feelings about this ?
Being mindful of you human needs indeed sounds like a good idea. Knowing when your emotions are in turmoil and maybe resorting to a late walk etc... Sharing emotions is part of taking good care of yourself and responsibly sharing them is part of building and maintaining human connections - it is NOT bothering. Of course Ex is not a good place for that and gf during that particular night also not a good place. But during better times "bothering" gf and others may be something to explore for yourself... .