This is the sort of thing that reminds me never to trust the accepted wisdom of internet groups.
Gandhi after being educated in England was only a little less racist then everyone else when he first went to South Africa and made the famous comment you’re referring to… He then had his awakening against oppression and began to fight for an end to racism, one of the main popular scandals against Gandhi in South Africa was that the medical corp he set up would give aid to whoever needed it first regardless of rank, colour or ethnicity. The rest of his life he wrote and fought for the rights of all.
But of course ‘popular person was actually bad’ is a fun hot take so of course it’s going to be banded around without any nuance.