Raid waves spawn regardless of block light level
Illager patrols have been programmed to only spawn in block light levels of 7 or less, so it is expected that raid waves behave this way as well, but instead they could spawn at any block light level. To reproduce, restrict raid spawning via the world border, and/or non spawnable blocks, and light up the remaining area to a light level of above 7 while still leaving some space for spawning. The raid may spawn right next to the light sources you placed down, despite the block light level being above 7.