Friend grilled by immigration on way out on first tourist visa ever

So my friend was in Malaysia for 90 days because that's how long she gets. She left to go to TH for 5 days before coming back. While leaving Malaysia she was grilled by the immigration officer. "You stayed 90 days", "why are you here?", "who are you staying with?", "are you coming back?". This is her first tourist visa ever.


Me and another friend who have been coming to Malaysia for almost 2 decades combined have never heard of someone being questioned after a single stay while leaving the country. She ended up saying she is coming back for a wedding. She was told she would need a copy of the wedding invite and the IC of the friend getting married.


Me and my other friend felt like this must have just been one asshole immigration officer proving themselves or something but I need some advice on what she should do when coming back. Is there a note on her file now that says she needs the wedding invite/IC number? would it be better for her to fly into a different port of entry on her way back? Anyone encountered something like this before?