So if a "true, valid ecumenical council" teaches that all the faithful must wear green shirts on earth day and sing hymns to Gaia, such a teaching must be considered infallible?
No, it would mean that it wasn’t a true valid ecumenical council.
Or that the authority promulgating such heresy would not be legitimate given the Holy Spirit protects the Church from teaching error.