I'm going to make a gunslinger and I read another thread about how cheap that first gun is to try to sell it. Then I read this thread on using the gunsmithing kit.
Gunsmithing states that you can make and repair guns, but can you take that old battered gun as either parts or raw metal to make your next gun?
It seems fine.
We had a guy in our last game who used armor we found on our adventures that he made into ingots (not with the kit) and then used that to make his next gun. So recycling the old gun doesn't see like a stretch.
Ask your GM.
The rule is there to prevent a gunslinger making extra money compared to other classes, so it should not be circumvented merely because you are being logical.
And the raw materials aren't that valuable, it's the complicated bit where they get turned into a gun that adds the value. I wouldn’t allow you to get an advantage over the other players: eg forging a new gun could require the use of a forge and that would cost you money to buy, rent, or build.
If you look at the gunsmithing feat it allows you to convert your initial firearm to masterwork.
You know the secrets of repairing and restoring firearms.
Benefit: If you have access to a gunsmith's kit, you can create and restore firearms, craft bullets, and mix black powder for all types of firearms. You do not need to make a Craft check to create firearms and ammunition or to restore firearms.
Crafting Firearms: You can craft any early firearm for a cost in raw materials equal to half the price of the firearm. At your GM's discretion, you can craft advanced firearms for a cost in raw materials equal to half the price of the firearm. Crafting a firearm in this way takes 1 day of work for every 1,000 gp of the firearm's price (minimum 1 day).
Crafting Ammunition: You can craft bullets, pellets, and black powder for a cost in raw materials equal to 10% of the price. If you have at least 1 rank in Craft (alchemy), you can craft alchemical cartridges for a cost in raw materials equal to half the price of the cartridge. At your GM's discretion, you can craft metal cartridges for a cost in raw materials equal to half the cost of the cartridge. Crafting bullets, black powder, or cartridges takes 1 day of work for every 1,000 gp of ammunition (minimum 1 day).
Restoring a Broken Firearm: Each day, with an hour's worth of work, you can use this feat to repair a single firearm with the broken condition. You can take time during a rest period to restore a broken firearm with this feat.
Special: If you are a gunslinger, this feat grants the following additional benefit. You can use this feat to repair and restore your initial, battered weapon. It costs 300 gp and 1 day of work to upgrade it to a masterwork firearm of its type.
I believe the OP wants to get rid of his old gun to make a new gun, and is asking if he can reuse the metal and wood in the old gun to forge his new gun so it doesn't cost as much.
With firearms (IRL), the majority of the value is tied up in the manufacturing process not the raw materials used.
Gunsmithing says you can make a new firearm with crafting materials equal to half the total price of the firearm, which is a disconnect from reality but that's fine.
If you're wanting to recycle, I would say you can remove the value of selling the old firearm (at half price) from the cost of raw material. Why? You can't reuse the wood for the stock unless you're making the same gun really, pieces wont line up. Metal....you need to melt the metal anyways and you're going to need extra metal to forge all the pieces, and it's honestly a balancing mechanism. Effectively you're just selling the old gun at it's normal half price value and spending that value on purchasing new raw materials. With the "recycling plan" you are cutting out the middle man some, depending on the value of the next gun you're making.