There's an upstream issue with openjpeg not encoding 1-bit images correctly if they're over a certain size. Which I missed in testing because I set the upper limit on the random arrays incorrectly (range is [0, high), not [0, high]...)
Workaround is to use a precision of 2 instead.