If my party tries to resurrect someone using the spell resurrection but the target refuses to come back to life, is the diamond (worth 1000 gold) needed to cast the spell consumed anyway?
Yes, the components are wasted.
Casting a spell with consumable material components requires that the components are consumed when the spell is cast (see the Components section of the Spellcasting chapter of the Basic Rules):
A spell's components are the physical requirements you must meet in order to cast it... If you can't provide one or more of a spell's components, you are unable to cast the spell.... If a spell states that a material component is consumed by the spell, the caster must provide this component for each casting of the spell.
The effects of a spell come into existence when the spell is cast (see What Is a Spell in the same chapter):
A spell is a discrete magical effect, a single shaping of the magical energies that suffuse the multiverse into a specific, limited expression. In casting a spell, a character carefully plucks at the invisible strands of raw magic suffusing the world, pins them in place in a particular pattern, sets them vibrating in a specific way, and then releases them to unleash the desired effect--in most cases, all in the span of seconds.
The effect of resurrection includes a condition: whether the soul is willing to return. Once you've consumed the material component for resurrection by casting it, the spell can fail to achieve anything if the condition fails, and the components are lost.
There are actually quite a few spells that would work in this fashion, effectively wasting their components during the casting if the benefit of the spell can't actually be manifested due to failing a condition. For example: snare consumes a rope in the casting in order to set a trap, but a creature could succeed on the save against the trap when triggering it, causing the spell effect to end without benefit for the caster. A rope is much less expensive than a 1,000gp diamond and a saving throw is a much more conventional condition, but as far as the rules are concerned there's no difference in how consumable components are treated.
But maybe a DM would be lenient.
As a DM, I would avoid wasting the caster's expensive component in most cases by warning them that the soul isn't willing and that the spell will have no effect, mostly because I think wasting the component would feel very disappointing at the table. I can think of an exception, however: a resurrection quest that has built up to the point of finally being able to cast the spell, only to find out that a creature you were certain to bring back isn't actually willing. In that case, wasting the component could be narratively satisfying.
My point is, if you're the DM, feel free to be lenient with the component. If you're the player, feel free to ask the DM if casting the spell would have any effect; they may or may not be lenient with the component.
And resourceful characters can avoid it all together.
In any case, the problem could be avoided by using a spell like speak with dead to ask the soul if it is willing to return, or by asking about the disposition of the soul or the likelihood of success using a spell like divination, augury, or commune, whose components are much cheaper. Thus a spellcaster could be fully informed before wasting resurrection's components, with or without DM leniency.