Crop out NZ from COP30 or GEBCO:
export dsn=/vsicurl/https://opentopography.s3.sdsc.edu/raster/COP30/COP30_hh.vrt
gdalwarp $dsn nz.tif -te 165 -51 180 -33 -ts 1024 0 out.tif
if you want bathymetry as well use GEBCO (will also be a lot quicker, so maybe this and then mask, see gdal_calc.py in linux)
export dsn=/vsicurl/https://gebco2023.s3.valeria.science/gebco_2023_land_cog.tif
gdalwarp $dsn gebco.tif -te 165 -51 180 -33 -ts 1024 0
gdal_calc.py -A gebco.tif --outfile=result.tif --calc="A*logical(A>0,A<1e6)"