While I don't going to said that it's a good cantrip, it isn't. You also seen to be missunderstanding the rules here
It always hit. But if the enemy success in a dex saving thrown it does no damage (damage spells that force a dex saving thrown, for example an old fashion fireball, do half damage on a succefull save but that applied to spells, not cantrips). This is in line with other cantrips. The difference is that enemies usually have good dexterety, sometimens even a class that gives dex saving throwns proficiency while other cantrips hit or not based on your magical attacks rolls alone. At game start your chances to hit are relatively good compared with your modifiers to saving throws.
It's one redeeming feature is that you theoretically don't need to see enemies to cast it. However, that's also inconsistent! If it's possible, a PC will waste all movement to cast sacred flame. I don't get a say so, despite it not being necessary. Then you're stuck with them on a terrible spot on the battlefield and no movement.
It needs vision, nothing in the cantrip rules said otherwise. It's just ignore cover (at it isn't a proyectile) wych isn't a rule in BG3 as mentioned before
Edit: There's also an issue with every ranged non proyectile attack in the game (not related to sacred flame) where when you try to do it without vision, it usually moves you to the worts posible place taking all the movement. This is a general issue with ranged non proyectile, not related to sacred flame. And the only solution , as far as I'm aware, is move manually to a place with vision.
It's better to do nothing at all than to cast sacred flame
It's better to do other things, do nothing at all can't posible be better as a cantrip don't take any resources. Usually any ranged attacks or attack roll cantrip would be better, but that is just a question of look at the % of success