Voadam
Legend
Beat me to the manastorm golem. Medium sized is a rarity for constructs.Perhaps an allip (Mordenkainen’s Tome of Foes, pg. 116)
While more of a minion, you could also use bookkeepers (Kobold Press Creature Codex, pg. 55)
Another could be a Manastorm golem (Creature Codex, pg. 203), with some minor revisions.
From Fifth Edition Foes there is the CR 9 furnace golem which could work if it is a fireball type wizard, but it is size large by default.
Tome of Horrors has a CR 5 medium sized ice golem with a recharging cold breath weapon that could be reskinned to be a spell.
Mostly anything with a ranged attack can be reskinned to be a caster type.