I think he could use more actions. His melee attacks are pretty good, but if you make the save they aren't that tough. His tail attack is worse on his legendary actions but its just a legendary and he has two of them. For 20th level PC I'd jack his AC up a lot and probably give him close to 1000 HP. His gaze is OK but its only a single round and save again so it wasn't a huge issue. If a PC failed then rolled attack nearest on the confusion table it could change things though, my guys had good saves against his gaze and the two that failed either lost a round being confused or were able to attack normally. But 5e and its kind of weak spell effect durations make that part of the core design.
My game is 6 players, though there were 8 PC in the final battle. So for a single boss you really have to jack the HP and AC up big time, the low AC values make hits very easy and just an extra attack or two really blows things up.
The group fought Grazz't at 7-8th level, and 6 PC were giving him a run for his money though it would have been a TPK eventually. They ran into Yeenoghou at 9-10th level and it was nearly a TPK but they had him one round away from going down. If they had both Paladins during that fight they would have slain him. Still only 1 of 6 survived. Then finally Demogorgon. Its hard to plan since you can't really plan for crits and when the rogues and paladins are critting on attacks with a lot of dice it changes things quickly.
4 L20 PC...good luck demon prince, barring bad luck I'm thinking its a 3-4 round pimp slapping. 6 L20 PC could probably clean out the Abyss...