I am expriening the exact same thing with my HTC-one(M8) T-Mobile.
Rooted. Unlocked. S-off.
It worked with 4.4.4 Kit-kat.
It did not work when I tried the "pure" Nexus experience.
That did require a factory reset. The phone even greeted with "Google" instead of T-Mobile.
I broke down, reloaded stock kit-kat with sense. Phone greeting went back to stock. relocked the phone (required factory reset), did the OTA upgrade. Miracast did not work. Unlocked (requiring reset). rooted. Miracast still does not work.
TLDR; Locked, unlocked, reset, vanilla Android, and Android/Sense are all no go with Lolipop and miracast.