Here's my current file. I left a map tag, Factory Slaughterhouses, of where I noticed the problem. (It's a Factory Mk2, with several Factory Mk1 inside, with several Slaughterhouses inside each.)
https://drive.google.com/file/d/102Lzz_ZDZL75hrxkzn0LbQbcbjyyfQKi/view?usp=sharing
It was interesting to me that the "disable farms with no modules" code works correctly on Factorissimo surfaces, but the T.U.R.D beacon spawn code doesn't.
(Also as a note, I am exploiting the "crop modules work in mining drills" bug in this save, so you might see some amusing behavior related to that.)