The explanation you're looking for is this. You are implicitly using the properties and , but this is only true when all the limits in these equalities exist, (disclaimer: there are important assumptions that I'm not writing but that should accompany these properties). More specifically, what you did (implicitly) was:
(Incorrect)
(Incorrect)
(Incorrect)
(**)
(*) As correct as something meaningless can be
(**) Actually correct, but it's too late