Hi asamofal,
New MySQL 8 temporary engine TempTable have shown various bugs and regressions in the early versions of MySQL 8.
What you can try doing is setting:
set global internal_tmp_mem_storage_engine=Memory;
and stop using TempTable in favor of previous memory storage engine used by MySQL before MySQL 8.
There are various bug reports that suggest doing this change such as:
https://bugs.mysql.com/bug.php?id=98782
https://bugs.mysql.com/bug.php?id=98739
https://bugs.mysql.com/bug.php?id=99593
https://bugs.mysql.com/bug.php?id=99100
Specifically the latter one resembles the issue you are currently facing. Give it a try and let us know if that works for you as a workaround while TempTable gets to a more stable version.
Regards