This is incorrect. The most evil person in the galaxy was the guy holding Vader's leash and taunting Luke into using his anger and hatred, and had patronized Anakin into believing he was better than anyone and fed his ego until it got the best of him and cost him his friends, his life as a Jedi Knight, and his family life. And decades later, nearly cost him his son and daughter.
Palpatine is the most evil one in the Throne Room. Luke originally thinks of Vader as the most evil thing before Cloud City, but feels something (something his mother felt before she died). That Anakin Skywalker, the good person that Qui-Gon and Obi-wan encountered a long time ago, was still inside the Vader constructed personality. Luke decided he needed to save his father from the Palpatine. But he still almost killed his father in a moment of anger and fear.
For Ben Solo, Luke noticed the darkness inside Ben and in a moment of weakness, nearly killed his nephew out of fear and anger. From the description, Luke saw the possible future and horror that Kylo Ren would inflict upon the Galaxy and Luke feared what might happen, and in his anger, drew his lightsaber. Than he remembered his training, and what nearly happened with his Father....but this time, it was too late....for Ben woke up and reacted poorly to the situation, and became the very evil Luke had foreseen. (Its like finding out the teenager you've been training will become a dictator that will kill millions of people and cause wars that destroy whole continents, and you have the chance to kill that teenage before they even harm one person....the old quandary: Do you kill Hitler when he was a student before the First World War? When he'd done nothing yet. Based on something that might happen?)
This is not out of character and makes sense with the character of Jedi Master Luke Skywalker. He is not perfect. He can see possible futures that can bring him great pain and he will sometimes act on impulse to these visions. He ran to Cloud City and nearly got himself killed, having to be rescued by the people he was trying to save (who managed to only need his Astromech to complete their escape). He has also been known to give in to his anger and fear from time to time. He's usually pretty good about pulling himself back to his center, but not before he at least starts to act of his anger or fear (see him force pulling his lightsaber from Palpatine's chair and taking a swing at him after being push and pushed to give into his anger repeatedly. After crossing sabers with Vader for a minute or two, Palpatines praises him and he realized what he was just doing, and turns his blade off and telling Vader he doesn't want to fight him. This pattern repeats, with Vader pushing the sister button, and setting Luke off again, Luke realizing he'd nearly killed his father when Palpatine interrupts with praise. Luke then throws his lightsaber away and flat out rejects Palpatine….which pisses of the Lord of the Sith , who decides he's had enough with this Skywalker and starts to fry him with Force Lightning. This of snaps Anakin's long lost personality into the front again, and he finally takes a action he probably should have done instead of cutting Mace's arm off decades ago.
Luke is not perfect. Nor does he ever thing he's perfect. He makes mistakes and he actually fears his mistakes, which actually makes it worse, if he doesn't learn from them first.