The /fill and /setblock command arguments do not work properly with any type of walls, fences, and stairs. I've included two pictures to show how fences and walls could be placed without them attaching to neighboring blocks.
I also attached several pictures showing the executed commands and their results. For example, when there should be a single fence post, it still attaches to the nearest solid block, regardless of the respective "direction" argument set to "false". The problem is similar with walls and stairs, they prioratize their surroundings over the commands.
Thank you for your report!
We're tracking this issue in MC-191096, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
π Bug Tracker Guidelines β π¬ Community Support β π§ Mojang Support
π Project Summary β βοΈ Feedback and Suggestions β π Game Wiki