Spoiler:The problem assumes that the top of the ladder is always in contact with the wall. It is not. When the bottom of the ladder is a certain distance away from the wall, the top of the ladder will not longer be touching the wall and the Pythagorean relationship will break down.