The issue that you are running into is that the system in the third case is more complicated than in the first and second cases. In the first and second cases the position of the block is sufficient to determine the amount of energy stored in the spring, so that would be two generalized coordinates.
In the third case more generalized coordinates are required to specify the state of the system. I would use two additional coordinates identifying the position of the pin on the plane and then another to identify what part of the spring is pinned. However, it is certainly possible to use different coordinates if you like.
In this larger parameter space it is clear that the work done by the spring is independent of the path taken to get there. There is a potential energy that depends only on these generalized coordinates, and not the velocity nor the history. The force is conservative.