I’ve created a simple theme component which exposes this Lightbox issue. Anyone should be able to reproduce the issue on any Discourse install by activating this theme component:
https://github.com/hayatae/lightbox-theme-component-bug
If anyone has any possible workarounds or suggestions, please let me know! I’m still not sure exactly why this breaks Lightbox.