The word must has two meanings as a modal verb: one indicates necessity, and the other probability.
The necessity meaning cannot be used about things in the past: instead, you use the past tense of have to. As an example, if you use reported speech you have to backshift the tense:
He said "I must go to the dentist"
He told me that he must go to the dentist - incorrect
He told me that he had to go to the dentist - correct
You can use the probability meaning to talk about about situations in the past.
He wasn't at his house: I thought that he must be at the dentist -correct
He wasn't at his house: I thought that he must have been at the dentist -correct
He wasn't at his house: he must be at the dentist - incorrect
He wasn't at his house: he must have been at the dentist -correct
When you are describing your what you thought or knew at the time, you can use simple present or present perfect: if you simply state the probability, you have to use present perfect to indicate that you are talking about the past. Of course, if you think that the situation is still true- for example, he is still at the dentist, you can use must, but then it's a present situation, not past.
Your example uses the probability meaning, so it's OK to use it about a past situation. You could also use present perfect to express the same meaning:
I knew that you must have been somewhere