I have a deadbolt where you sometimes can't open it, the key turns a quarter turn but doesn't seem to "move the deadbolt" as it were. Or sometimes the key can't even turn at all. It doesn't "spin forever"
Turns out it was either the key (a copy of a copy) was going bad, or else the deadbolt needed to be slightly adjusted to open and close more easily without catching as much. Or that you needed to "pull on the knob" while twisting to ease up on tension. Some combination of those three, my hunch is it was the key needed replacing.
If it just spins "forever" I'm told that's either a detached or broken "tailpiece" (the little rod that goes out from the key into the middle). If it's just broken you may be able to replace it. I asked a local keyshop they said they had generic that "might" work for like $3 for the part. Google it "deadbolt tailpiece" for videos etc.