How can I load an anndata object when 'raw' was saved as a dictionary

Pretty much what it says on the title. I saved an anndata object after integration and cell type labelling without any issues whatsoever and now when I try to load it I always get the following error:

AttributeError: ‘dict’ object has no attribute ‘shape’.

It seems ‘raw’ is being loaded as a dictionary instead of the expected format, which causes an AttributeError when trying to access attributes like ‘shape’ that are expected on a NumPy array or similar object.

I tried using different anndata versions and even selectively loading the data from the h5ad file (Reading Anndata from only parts of h5ad file: Hack solution · Issue #1517 · scverse/anndata · GitHub) but I’m having some trouble. What should I do?