You can avoid criticizing your mentee directly by comparing their situation to something similar in your past. Talk about a mistake you made in your career and what you learned from it. By redirecting the correction from them to you, you’ll push them in the right direction without shutting them down. You’re taking the focus off of your mentee while still sharing the intended lesson.
Have faith in your pupil’s ability to make the association you intend. They’re likely more resilient than you think, and if you work on building a strong bond built on honesty and trust, they’ll take your feedback in the spirit it was intended.