The /setblock command will only set the block IF where it is going to place it, is the chuck loaded. For example, I'm at x:0 y:50 z:0, and I use "/setblock 0 50 100 minecraft:snow 0 replace", this should set a block (snow block) at x:0 y:50 z:100, but this actually won't happen, this is because the chuck where the coordinates "x:0 y:50 z:100" are, isn't loaded.
If you want to fix this, you could use a "Chuck Loader" (for example, put the hoppers, one next to each other, and with an item inside one; just like a clock).
Duplicate of MC-32485 - If you have not, please use the search function in the future, to see if your bug has already been submitted. If you could not find the original report, please comment with the keywords you searched for.