Why might this not work?

execute at @a if biome ~ ~ ~ minecraft:eroded_badlands run effect give @s minecraft:mining_fatigue 1

Continue to help post