You could say exactly the same thing about a player going to head a ball and knocking someone out. It’s not a requirement to head the ball in as much as punching isn’t for a goalkeeper. Cahill ended Mason’s career. Luiz put Jiminez into intensive care. Both of them missed the ball, I don’t remember anyone calling for either of them to be red carded.
There’s a clear law against a high boot. Instead of using your boot you can use your head or upper body. A keeper can use his hands at any height. If Mane had gone with his head, and had the same result, he would not have been sent off. This Red Card was also massively debated and condemned at the time.
Theres a clear law about playing in a manner that endangers an opponent