The error message associated with your failed run is
“The ‘X’ field in this h5ad file lacks the ‘encoding-type’ metadata field. That field is necessary for this software to determine if this data is stored as a sparse or dense matrix. Please see the anndata specification here\nOn-disk format — anndata 0.11.1.dev11+g2602e5b documentation”
May I ask: with what library/piece of software did you create your h5ad file? If the answer is the python anndata library, what version of anndata did you use? It appears that whatever created your anndata file did not produce a file that is consistent with what the published anndata specification says an h5ad file should look like.