These are interesting findings but also rather confusing due to (1) the discrepancy between running on Mac and Linux and (2) how this problem is very clearly supposed to be avoided in the code, but the wrong pathway gets triggered. It seems like it would be a really good candidate for further investigation and potentially a PR for Aesara, which is the up-to-date successor of Theano currently being developed.