Back in May 2017, while changing the behavior of non-temp writes @aaron added a comment to Database.php:
# In theory, non-persistent writes are allowed in read-only mode, but due to things # like https://bugs.mysql.com/bug.php?id=33669 that might not work anyway...
At the time, though, that bug had been closed for ~7 years.
Since extensions like SMW can depend on temporary tables when they aren't doing write operations (see #ask queries don't work when $wgReadOnly is set), and the bug addressed was seen as a bug and fixed, this change in behavior needs, at least, more explanation than just this comment.
Of course restoring the old behavior of allowing temporary tables when $wgReadOnly would be awesome, too.