Having said that, I’ve created raids before and disbanded them and the former group members stayed in same shard. Might depend on numbers in the zone. I’d have to experiment, but pretty sure players can disappear from current shard when leave group. And a Nazjatar battle lfg group is typically abandoned within a few seconds at end.
Edit: yeah it’s to do with the group leader’s shard.