Yeah - this seems likely, it looks like there is hidden assumption that the topography source file is larger than the model grid:
This doesn’t make sense, this line shouldn’t by impacted by changing the topo file. It’s just writing the model grid coordinates to the new output file.
I think line 218 might have a bug - it should use dids_topo not dids , although how it ever works is a fluke/mystery!