Edit: this issue is meant for Minecraft Bedrock Edition, not BDS. Please remove this bug report, I will create another one in the proper category. My apologies for the mess.
Slimes are supposed to spawn in swamps in light levels 0-7.
However, in version 1.19.81 as well as 1.20.0.22 Preview, slimes only appear to spawn in swamps with a block light level of 0, and don't spawn with block light levels 1-7.
Please find attached a world that demonstrates the issue.
If you remove the lights, slimes will spawn properly. With the lights, slimes won't spawn.
(new report MCPE-170073)