Error occurs when using MAT's matwrite and HDF5

I’m writing mat files in a loop. The following error occurs somewhere after a few successful outputs. All the files have the same framework except for its size. But their size are also comparable.

=================================================================
HDF5-DIAG: Error detected in HDF5 (1.8.13) thread 0:

#000: /home/abuild/rpmbuild/BUILD/hdf5-1.8.13/src/H5T.c line 1730 in H5Tcopy(): unable to register datatype atom

major: Datatype

minor: Unable to register new atom

#001: /home/abuild/rpmbuild/BUILD/hdf5-1.8.13/src/H5I.c line 895 in H5I_register(): can’t insert ID node into skip list

major: Object atom

minor: Unable to insert object

#002: /home/abuild/rpmbuild/BUILD/hdf5-1.8.13/src/H5SL.c line 995 in H5SL_insert(): can’t create new skip list node

major: Skip Lists

minor: Unable to insert object

#003: /home/abuild/rpmbuild/BUILD/hdf5-1.8.13/src/H5SL.c line 687 in H5SL_insert_common(): can’t insert duplicate key

=================================================================

Could anyone help?

I have had less glitches using MATLAB.jl to write mat files, but no idea specifically in the issue youare facing.