I don't sure, please explain a bit more why it's an error.

Another example:
```
In [7]: p = (x - y + 1)**2 - (x + y + 1)**2 + 4*x*y

In [8]: p.expand()
Out[8]: -4⋅y
In [9]: p.free_symbols
Out[9]: set([x, y])
```