How does rebirth work for arahant and non-arahants? I read in a sutta a few days ago (I can't remember the exactly where) that the question of rebirth after parinibbana is not a valid one, because there was no one to be reborn.

But if anatta is valid not just for arahants, but for all conditioned phenomena as well, does that mean that rebirth is also not applicable for non-arahants either?

Thanks for your time!
Indeed puthujjanas knows that it makes no sense to ask where a fire go once it is put out, unless those puthujjana managed to create a fantasy where they deify fire..., so the buddha says that It makes zero senses to ask where an arhant goes, or if an arhant exists after parinibbana, by creating a parallel between fire and craving (or fire and existence).
Same thing about the stupidity of trying to figure the non-existence of a buddha.

It is craving that is the path to vedana, the 5 aggregates, birth, dukkha and all that stuff, so once there is no craving, well there is nothing left and there cannot be birth again.