The game I ran made it to level 20, and there's not much difference between levels 18 and 20 - the characters are unstoppable dreadnaughts who can stomp over anything you put in their path. If you want a balanced encounter that should make them take notice, I recommend three Solars or a dozen purple worms.
Worms huh. How about this. Something I have been working on.
Sandworm
Colossal Monstrosity Unaligned
Armor Class 26
Hit Points 820 (40d20+ 400
Speed 40 ft Burrow (Sand) 40’
Str 30 (+10),
Dex 20 (+0),
Con 30 (+4),
Int 3 (-4),
Wis 10 (+0),
Cha 11 (+0)
Saving Throws Dex +10
Str +16,
Con +16
Int +2
Wis +6
Cha +6
Skills Athletics+22 (expertise)
Damage Immunities fire, lightning, bludgeoning, piercing, and slashing weapons that are not magical
Damage Resistances All except poison and psychic damage.
Condition Immunities charmed, frightened, paralyzed, petrified.
Senses Blindsight 120’, passive perception 16
Languages –
Challenge 30 (155 000)
Legendary Resistance (3/day).If the Sandworm fails a save it can chose to succeed instead.
Spell Immunity: Sandworms are immune to level 1-9 spells
Magic Weapons: The Sandworm weapon attacks are magical
Emergence When a Sandworm first emerges from the sand lightning bolts strike all beings within 50’. Each bolt deals 6d10 lightning damage to each target. A DC 20 dexterity save reduces the damage by half
Actions.
Attack. The Sandworm makes a bite attacks and a thrashing attack.
Bite: Melee : +19 to hit, reach 15’, all targets within 20’ area. Hit 62 (8d12+10) piercing damage. If the target is a creature it is grappled (escape DC 20). Until this grapple end the targets are restrained and the Sandworm cannot bite more targets.
Thrashing . The Sandworm thrashes its body around crushing everything within 50’. All creatures in that area 20d6 (70) bludgeoning damage. A DC 26 Dexterity save reduces the damage by half.
Swallow The Sandworm makes a bite attack against a gargantuan or smaller creature it is grappling. If the attack hits the targets take the bites damage, the targets are swallowed and the grapple ends. While swallowed, the creature is blinded and restrained and takes 10d6 acid and 10d6 fire damage at the start of the sandworms turn.
If the Sandworm takes 60 or more damage from a creature inside it, the sandworm must succeed on a DC 20 constitution save or regurgitate all swallowed creatures, which fall prone in a space within 10’ of the Sandworm. If the Sandworm dies, a swallowed creature is no longer restrained by it and can escape from the corpse by using 30’ of movement, exiting while prone.
Legendary Actions
The Sandworm can take 3 legendary actions choosing from the options below. Only one legendary action can be used at a time and only at the end of another creatures turn. The Sandworm regains spent legendary actions at the start of its turn.
Attack. The Sandworm makes a bite attack.
Move. The Sandworm moves up to half its speed.
Chomp (Costs 2 actions)The Sandworm makes one bite attack or swallows.