Plenty of answers answer the question that it happens but I can't find a good answer as to why the wind shifts during the passing of a front.
For an extreme example see:
(in Dutch, x is hours and y is wind direction in degrees)
Where a passing cold front moved the wind directon from south to northwest.
The other question provides a very broad answer as to why wind changes in general and the answers there are applicable in general. My question is about the specific circumstances of a thermal front and what causes the change in the balance of forces to suddenly allow or force the direction of the wind to change direction.