The error might be because the library cannot find the file/variable that was passed in the “H5P.set_extent” command.
Refer to the below documentation links on how to use the “H5P.set_chunk” and “H5P.set_extent” commands:
You can also refer to the following link to see how to replace a dataset with a smaller dataset in a HDF5 file: