Fix render-to-tex when format temporarily mismatches

Should fix #6392.

-[Unknown]