Update: After further drilling, the problem turns out to be that d8, a standard Android tool and **actually secretly a bat file**, contains an incompatibility with modern Java. This is the "new" dexer introduced in 2017. It requires Java 8 or older to run. No idea where I'm supposed to get that; Android Studio installed Java 11.
https://stackoverflow.com/questions/59896708/error-while-running-dx-or-d8-tool-for-android
SO notes you can edit the file to fix this but "However, since Android Studio notices such changes, it removes those files from time to time"