Sorry for my inaccurate descriptions earlier
Pillagers in outposts never spawn but the iron golem spawns when I set difficulty to easy, normal or hard and doMobSpawning to false.
Pillagers should spawn even when doMobSpawning set to false since it's a part of the outpost
These are passive mobs or defensive mobs, which means it's not a bug.