A planned course of action is wrong when it does nothing but serve your ego. Telling someone they’re unattractive is precisely that. You’re not helping them at all, and there’s always going to be a more tactful way to communicate whatever you need to communicate to them.
In the first place, you could tell them that you are not attracted to them. Saying they’re unattractive means that they are unattractive to everyone. Nobody is unattractive to everyone, so you’re making an untrue statement in order to benefit nothing more than your ego.
In the second place, there are better ways to reject someone than to tell them you’re not attracted to them. I’m assuming the reason you’d be telling them this is because they asked you out and you want to be honest about why you’re rejecting them. It’s literally the only reason why I can think one would have a legitimate reason to tell them something like this.