So right away it doesn't make sense for the limit to exist for 3, but not 4.
So let's look at it:
Now for we get:
is the one you had trouble with. Now you know that means it approaches 5 through negative values. But this doesn't always imply that we have a negative number. As x approaches 5 through negative values it must also pass through the interval , and these are non-negative. So we actually get:
And again, for and you are getting negative square root, so indeed, an illegal operation.