To reproduce, use "The Void" preset on superflat, place a bed and spawn a villager right on the edge of the platform, then start a raid and go on the opposite side to see illagers spawn on the platform very close to the player, or sometimes even inside the player.
Linked issues
relates to 3
Attachments
Comments 2
All mob spawning is based on whether chunks are loaded, so your point is invalid. Since raids are a player caused occurrence, they can spawn at any light level, but phantoms and “summoned” zombies (caused by hitting certain zombies) are also a player caused occurrence and you don’t see them spawning right in your face.
This is working as intended. The distance raiders spawn from you is based on your render distance.