That's...horrible advice generally, though there are specific circumstances where it might be useful, and it is tragic if it was an example used in a diversity panel as anything but a negative example without a whole lot of context because it (1) appeals to race/gender stereotypes, and (2) requires, for it to even approximate actionable advice, for the mentor and mentee to share race/gender stereotypes. In fact, I've been to lots of such panels/trainings, and fairly commonly seen exactly that used as a negative example.
What would be more useful if your first instinct is to give this advice is to first unpack what behavior you are stereotyping as white/male behavior that you actually want to encourage, and then just advise that behavior without appeal to race and gender stereotypes.