The 22-year-old was among the goalscorers as Ottmar Hitzfeld's side defeated Albania 2-1 on Friday.
That triumph secured Switzerland's place at the next year's tournament in Brazil, with the team winning six and losing three of their nine fixtures in qualifying so far.
But he will now return to the Bundesliga champions to have his injury assessed by Bayern's medical team.
On Shaqiri's injury, Hitzfeld said: "In a situation like this, you have to be aware of your responsibilities to the player and his club."
Shaqiri has been a regular feature in Pep Guardiola's side this season, appearing six times in the Bundesliga and contributing one goal.
Bayern sit at the summit of the table with 20 points from their eight fixtures.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.