I agree that the instructor probably misheard! But some context might be helpful.
"Keep your mouth shut" is a very rude, often aggressive or threatening way of telling someone to stop talking, or to not say anything (maybe about a particular subject). You could say it to a friend in a non-serious way, but you wouldn't say it to someone you were being polite to. If the instructor thought you said this to somebody, they definitely might criticise you for it!
"I'll keep my mouth shut" isn't about another person, so it's less confrontational - but it isn't exactly polite. It can be a bit like telling yourself to shut up, and some people might be sensitive to that kind of language. It can also imply that someone is ordering you to keep quiet - "I'll keep my mouth shut" can sound like someone is forcing that on you, or you've offended them, or you're implying there's something bad you're promising not to mention.
So I agree with the other posters who think they'd probably say "I'll keep my mouth closed" - it doesn't have any of that baggage or negative association. "Mouth closed" usually just means "not open", but "mouth shut" usually means "silent"