Having done some digging, I suspect the bug is related to this commit: https://github.com/EpicGames/UnrealEngine/commit/3e13bde4ddf3f90cc0d91cf4508a9c48dff64561
The expression that I think the optimizer is struggling with is accessing the XRPassthroughCameraUVs Vector4, and this commit landed after 5.1 and altered the metadata around this uniform.
Unfortunately I don’t see a way to work around it in the plugin itself, which I’ve forked. But if I figure out a workaround I’ll post it here.