With take care, the issue isn't really about whether the register is formal or informal. If there is incongruence read into "Take care, sir", it comes from the different degrees of social distance implied.
I'm using the term somewhat loosely, but the version of social distance I'm referring to is affective social distance:
According to this approach, social distance is associated with affective distance, i.e. how much sympathy the members of a group feel for another group.
- wikipedia
Here, take care is something that one might say to a close friend or loved one, wishing them well with a degree of tenderness. It carries the connotation that the wisher and the 'wished' are close.
On the other hand, addressing someone as sir instead of using his name or a term of affection implies that the speaker and the person addressed are not close.
You ask:
How formal / informal is take care used in the meaning of goodbye? Is it appropriate to be mixed with the addressing by sir (when meant seriously and not in a funny way)?
The phrase "take care" used as a farewell isn't necessarily formal or informal, just as a word like "Hello" isn't easily categorised as formal or informal. Also, "take care" doesn't mean goodbye, even though it is a farewell wish.
In a situation such as the fictional workplace setting between Tony Stark the boss and his extremely close member of staff, Pepper Potts, the mixture of close and distant language expressed in "Take care, sir" can work. In the scenario you asked about, it might also work if the assistant was trying to express friendliness within the constraints of the protocols she had to follow.
A parting "Take care, sir" to you isn't necessarily inappropriate, but it suggests (whether real or manufactured) a degree of concern for your well-being.