When using /setblock to place a dispenser with a rotation datavalue, if the front of the block is against a wall the dispenser will point the opposite direction when placed.
To Replicate: Place a block. Attempt to spawn a dispenser one block north of it, with a rotation data value of 3 (Telling the dispenser to "look" south). The block will instead face north. Same happens for east/west.
Affects the following blocks:
dropper
dispenser
observer ❓ (can't see due to MC-108054, may be affected if that's fixed)
(lit_)furnace
Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by
relates to
Comments

Possible related to MC-12437
Hi Q!

Cannot reproduce in 1.8.2-pre6, resolving to MC-31365.

Confirmed for
1.8.4 (tested and because of MC-80124)

Confirmed for
15w37a

Confirmed for
1.9.2

Please link to this comment in the description
The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.
The reason why this happens is because the method net.minecraft.block.BlockDispenser.setDefaultDirection(World, BlockPos, IBlockState)
is called after the block was placed. This means the method is also called when a player places a dispenser, despite the fact that afterwards the method net.minecraft.block.BlockDispenser.onBlockPlacedBy(World, BlockPos, IBlockState, EntityLivingBase, ItemStack)
is called which uses the old rotation again.
Confirmed for 1.10
Also tested with fill command and got the same result. The command should have placed six droppers facing north. The first two had stone north of them and faced south instead. The next three had air and faced north. The last one had glass and faced north.
Can confirm in 1.11 snapshots easily using blockstates: /fill ~ ~ ~ ~2 ~ ~ minecraft:dropper facing=west
will have two droppers facing the wrong direction.
Confirmed up through 17w16a.
Confirmed for 1.12-pre5. Also happens with structure blocks.
Confirmed.