It could be done with r.neighbors in grass :
Sum number of cells using a 3x3
Count number of cells without Nan/Null value using a 3x3
Divide first generated raster by second one
Example :
Set a random region 3x3 cells
g.region rows=3 cols=3
Initialize with random cell raster
r.random.cells output=random_cells distance=0 ncells=5

Sum cells (3x3 is default but you could use -c option to set a different cell research)
r.neighbors input=random_cells output=sums method=sum
Count cells
r.neighbors input=random_cells output=counts method=count
Change region resolution to output desired raster resampling :
g.region res=1
Divide sum by count
r.mapcalc "outresamp = sums / counts"
Optinoal : copy colors from random cells to newly resampling raster :
r.colors map=outresamp raster=random_cells

https://grass.osgeo.org/grass78/manuals/r.neighbors.html
Alternatively, you could use interpolation with r.fillnulls or r.resamp* methods