Alright so what I understand from your question is that you are in fact doing LESS damage with Dragon Claw, a base 80 STAB physical attack than Headbutt, a base 70 physical attack on a Shelgon.
This is basically impossible as Dragon Claw goes up to base 120 power counting STAB, while Headbutt remainds the same. Since they use the same stat to calculate the damage, Dragon Claw should be at a higher damage.
The only case where I can think of which Headbutt would do more damage, would be if it was a Critical Hit. Since Critical Hits double the damage of an attack, perhaps that is what happened which caused Headbutt to do more than Dragon Claw.
If not, it's probably some kind of bug or glitch, so reset the game and try again I suppose.
Here's a ridiculously far-fetched possiblity however, assuming you're playing Gen V
If Shelgon got hit by Soak and is holding a Normal gem, theres a possiblity. Since Soak changes you into a Water-type, nullifying your STAB and Normal Gem would boost Headbutt to base 105 power for one time, Headbutt would be stronger. This is ridiculously situational and would only work once by the way :P
Anyway these are all under the assumption you're battling the same Pokemon. yay :D