Assign raster values to a grid (polygon) in QGIS

With QGIS one possible workaround is as follows. First, I created a polygon fishnet from raster layer for the following image (50 % of transparency for visualization purpose):

enter image description here

Afterward, with the Polygon centroids Processing tool, I created a centroids layer corresponding to the fishnet; as can be observed in following image.

enter image description here

Next I used the v.sample Processing tool for sampling raster values corresponding to centroids for each feature of fishnet. Sampled raster values can be observed in the Attributes Table of following image for Sampled memory layer produced.

enter image description here

After creating an id field in the Sampled layer, I used a Spatial join to the fishnet layer, using id as join and target field. Finally, fishnet is saved with another name and unnecessary fields (different to raster values) were deleted; as it can be observed at following image:

enter image description here