At a more fundamental level than the Liskov Substitution Principle, this is a category error or category mistake
In the context of modeling behaviour a square simply is not a type of rectangle.
When you realize this the problem evaporates since the initial assumption (a square is a type of rectangle) is removed from play.
The issue with this answer is that since school it is drilled into anyone doing geometry that a square is a type of rectangle. But it is very important to understand that this is only true within a very specific context (the classification of geometric shapes based on the properties of their internal angles). In terms of behaviour a square is not a rectangle. To view one set of classification in the wrong context is a category mistake.