Sounds like you could go quite far with just writing a couple of events to turn vassals and courtiers heretic if the ruler is... that, coupled with a heretic diocese bishop converting, should make your kingdom heretic in no time... Or just get that diocese bishop even. Did he also try to convert the ruler, or only other courtiers?