If you use a crowbar on the inside of a fence to dismantle its parts you are returned the materials used. For the metal/wood up/down you are returned the planks or sheet and some nails. However once you destroy the base (the two pillars you first build) the nails and metal will disappear even if in your inventory.
Example. I pulled apart a fence and received roughly 30 nails and 8 metal. I placed these inside my inventory. Then once I destroyed the base they were gone and not there after a relog. I have also had these disappear from a barrel!
I did once combine the nails i got back with nails i had in my inventory already and then split that stack. I then pulled apart one more piece and kept the nails from that action separate to the others. After destroying the base the separate nails disappeared but the nails i combined and split remained.