Julia;
The problem may be due to using a too coarse raster for your polygons. For example, if only one cell intersect a polygon you may not get values as, if I am not mistaken, the centroid of a raster cell must be located inside the boundary of the feature for which you are making calculations.