I found the solution! I recently turned off the legacy encryption. I did this after following the guide that said that I should run occ encryption:scan:legacy-format
to check if I could turn off the legacy encryption, which the command confirmed that I could turn off. This resulted in the error above.
I solved it by turning the legacy encryption back on.
'encryption.legacy_format_support' => false
back to
'encryption.legacy_format_support' => true,