gh-37747: be more specific when raising "not a constant polynomial"
Currently, if retracting a polynomial to its base ring fails, the error
message is `TypeError: not a constant polynomial`.
In some circumstances, this is not very helpful, because it may be hard
to find out where the nonconstant polynomial comes from. In particular,
this happens when the lazy implicit equations solver (#37033) fails.
Therefore, it seems sensible to add the offending polynomial.
URL: https://github.com/sagemath/sage/pull/37747
Reported by: Martin Rubey
Reviewer(s): Matthias Köppe