In the US, a year of family leave is, to say the least, unlikely, and legally required nowhere. But even if it were, most companies that last long enough to have somebody come back from a 1+ year leave most likely are, or have become, large enough that there's no reason to lay off the "replacement".
Developers in particular are rarely terminated individually for economic reasons. There's always something for them to do, some way to extract value from them. Companies don't usually start dropping good people until they're dropping a bunch of them at once, and usually deadweight layoffs have preceded.