If I use /setblock to place a redstone block under a junction rail, it changes direction, like it should. However, if I then use the same command to set the block underneath to something else (something like stone, that won't power the rail), the junction does not switch back, acting as if it is still powered.
because no replacement type/replace ment type replace don't cause block updates, use:
for example