InvalidOperationException when migrate to HDRP

On updating a project from the URP to the HDRP I am now getting errors on the Scene tab of the editor, it says that the multipassCameras variable which comes from m_XRSystem.SetupFrame is being modified before the loop over the array can complete. I’ve no idea why this would be.