gh-37753: Added rank check to doctest in `.gauss_on_polys`
Fixes #37732. Also removed assignment of vectors `v` in the same doctest
since they are not used.
URL: https://github.com/sagemath/sage/pull/37753
Reported by: Sebastian A. Spindler
Reviewer(s): Martin Rubey