As I understand it, immunity to earth magic doesn't grant immunity to the "slow" spell if it targets the ground – is this even possible to resolve?
For example, I took a simple approach: all creatures with immunity to earth (earth elementals and Earth & Air dragons) also received an ability that grants immunity to slow, but there are few individual abilities for specific spells, so this solution isn't really a solution...
Auto-translated