I'm hoping this will provide some pointers for debugging https://github.com/matrix-org/synapse/issues/7968.