The error shouldn’t be raised by overheating, but your system / GPU should instead shutdown to prevent damage.
Maybe some zombie process was still using some GPU memory and thus creating an OOM error.