OK OP, for the party you describe above - try this:
Alias
Medium Undead, neutral evil
Armor Class 22 (natural Armor)
Hit Points 300 (35d8+140)
Speed 40 ft., fly 40 ft.
STR-14 (+2), DEX-20 (+5), CON-18 (+4), INT-13 +1), WIS-18 (+4), CHA-24(+7)
Resistant: Psychic, Cold, Lightning*, Radiant*
Immune: Necrotic, Poison; Bludgeoning, Piercing and Slashing from nonmagical weapons
Condition Immunity: Charmed, Exhaustion, Frightened, Paralysed, Poisoned, Stunned
Saving Throws Con +12 Wis +12, Int + 9
Skills: Insight +9, Perception +12, Persuasion +15, Deception +15, Arcana +17, Acrobatics +13
Senses: truesight 120 ft, passive perception 22
Languages: all, Telepathy 120’
Challenge 23 (50,000 XP) – Proficiency bonus +8
Regeneration- Alias recovers 30 hit points at the start of his turn as long as he has at least 1 hit point, and he hasn’t taken any radiant damage since the end of his last turn.
First to battle: Alias treats all Dexterity checks to determine initiative as if he rolled a natural 20.
Jack of all Trades: Alias gains +4 to any ability checks that he does not normally add his proficiency bonus to.
Legendary Resistance (3/Day). If Alias fails a saving throw, he can choose to succeed instead.
Magic resistance. Alias has advantage on saves vs other spells and magical effects.
Magic Weapons. Alias’ weapon attacks are magical.
Turn Immunity – as Revenant
Hateful Ricochet: As a reaction, Alias adds +8 to its AC against one melee Attack that would hit him. To do so, Alias must see the attacker and be wielding a melee weapon. If this reaction causes an attack to miss, Alias can make one attack with Mythcarver at the same creature, and as part of the same reaction.
Spellcasting- Alias is a 17th level spellcaster. He uses Charisma for his DC and spell attacks (DC 23). Aliases spells are cast without somatic or material components, using the power of Song of Chaos in the Dark speech of Thanatos. He has the following Bard spells prepared:
0-Mind Sliver, Minor Illusion, Friends, Thunderclap
1(4)- Bane, Cure Wounds, Healing Word, Thunderwave
2(3)- Misty Step, Invisibility, Suggestion
3(3)-Dispel Magic, Major Image, Lighting bolt
4(3)- Greater Invisibility, Dimension Door, Death Ward (1 slot used)
5(2)-Scrying, Synaptic Static, Steel Wind Strike
6(1)-Ottos Irresistable dance
7(1)-Teleport
8(1)-Glibness, Feeblemind (1 slot used)
9(1)- Foresight (1 slot used)
Alias has cast Death ward, Glibness and Foresight prior to any battle with the PC's.
_____________________ Actions _____________________
Multiattack- Alias makes two attacks with Mythcarver, and one attack with Deconstructing Touch:
- Mythcarver - melee weapon attack +15 to hit, one target – Hit: 12 (1d10+7) slashing and 14 (4d6) force damage.
- Deconstructing Touch: - melee spell attack (+15 to hit). On a hit, the target must make a DC 15 Con save, or magically take 10d6+40 force damage on a failed save, or half as much on a success. If the target is reduced to zero hit points, they are disintegrated, and are reduced to dust.
Legendary Actions (Alias has 3 legendary actions)-
- Striking Enmity (1)- Alias makes one attack with Mythcarver
- Quickened Retort (1-3)- Alias expends a number of legendary actions in order to cast a spell of a maximum level equal the number of actions spent x 2
- Lightning reflexes (2)- If Alias has spent his reaction, he instantly regains it as if it were the start of his turn
Equipment: Alias has Boots of flying, Mythcarver (a +2 Longsword with the Finesse property that grants its wielder advantage on Charisma ability checks) and Half plate of Radiant resistance (factored into above), and a Ring of Lightning resistance.
-----------------------------
Tactics:
Alias is immune to being surprised (thanks to Foresight) and always gains an initiative check result of 29 (thanks to his First to battle and Jack of all Trades ability).
On his first turn, he targets the Ki-Rin with Dispel magic. Thanks to Glibness his Charisma check is 15, plus 7 for Charisma, plus 4 for Jack of all Trades for a total result of 26 - meaning True Polymorph is dispelled and the Ki Rin is reduced to his normal form.
He then flies 40' straight up.
He makes judicial use of Counterspell to counter any attempts by enemy casters to counter any of his own spells including the dispel magic (his counters cannot themselves be countered as they lack any V, S or M components).
If engaged in melee and he still has his reaction available, he uses Hateful retort against the first attack that hits and is less than a 30 (granting him an AC of 30 and causing the attack to miss) and then whacks the martial PC with mythcarver as part of the same reaction.
For his first legendary action, he refreshes his reaction if it is spent with his lightning reflexes ability. If it is not spent, he uses Quickened retort to blow 3 legendary actions to cast Steel Wind strike (+15), ending his reaction within 5' of the Wizard, and as far away from the Barbarian and Paladin as possible.
He also frequently uses this reaction to cast Misty step for extra movement (1 LA), Dispel Magic (2 LA) if there are any problem spells in operation, or for other spells such as pinning an enemy martial to the spot with Ottos irresistible dance for 3 LA (although his preference is to recharge his reaction to enable him to counter enemy spells, and to use his Hateful retort Parry ability to scare the melee fighters to death).
If trapped in a forcecage or wall of force he uses Misty Step to escape, using his reaction to cast it if necessary.
Your parties weakness is they lack the ability to fly (barring the Ki-Rin) and are extremely melee centric. Dispelling the True Polymorph on the Ki Rin will have the PCs on the back foot from the start of the encounter, and they'll have to figure out how to deal with a flying spellcaster, who can parry 1 attack each turn, and can easily counter the Wizards attempts to get the Melee guys flying.
The Wizard needs to figure out how to get more than 60' away from Alias or become unseen (to avoid his counter spells) or wait till Alias is out of reactions (ready action perhaps) in order to cast Fly on the PC martials.
In other words, they'll have to think their way out of this one.