dnd 5th – How is the official CR of the necromancer calculated?

I plan to make a variation of the official NECromancer NPC text block Volo Guide on Monstersand I wanted to make sure the challenge score was correct compared to the original. However, as this is a caster, the calculation of the CR becomes a little weird.

I have done my best to calculate the official necromancer's CR based on health, AC and maximum spell damage, but the CR never seems to reach 9, which is the correct number.

Here is the statistics block of the original necromancer:

Medium Humanoid, All Alignment

Class of armor: 15 (wizard armor)
Points of damage: 66 (12d8 + 12)
Speed: 30 ft

STR 9 (-1)
DEX 14 (+2)
CON 12 (+1)
INT 17 (+3)
WIS 12 (+1)
ACS 11 (0)

Backup throws: Int +7, Wis +5
skills: Arcane +7, History +7
Damage resistances: necrotic
languages: Four
Challenge: 9 (5000 XP)

Features

Spellcasting. The Necromancer is a level 12 caster. His spell casting ability is Intelligence (DC 15 spell save, +7 to launch spell attacks). The necromancer has the following wizard spells:

Cantrips (at will): cold touch, dancing lights, mage's hand, mending

1st level (4 places): false life, * mage armor, radius of illness*

2nd level (3 slots): blindness / deafness, * weakening radius, * the Web

3rd level (3 slots): animate the dead, * spread the curse, * vampiric touch*

4th level (3 slots): rust, * dimension door, stone skin

5th level (2 slots): Bigby's hand, cloudkill

6th level (1 location): circle of death*

* Necromancy of 1st level or higher

Grim Harvest (1 / round). When the necromancer kills a creature that is neither a build nor undead with a level 1 or higher spell, the necromancer regains a health number equal to twice the spell's level or three times if This is a necromancy spell.

actions

Touching withering. Melee attack: +7 touches, reach 5 ft., One creature. Hit: 5 (2d4) necrotic damage.


Can any one explain why this monster has a CR of 9 and how to calculate it?