Sure, relays can fail, like anything else... contacts can become corroded or burned, etc. They can even weld themselves together
.
As mentioned above, sounds like you may have a loose connection somewhere, or the ignition switch, depending on what it is could be the culprit, too.
If it happens again, you could try swapping out the relay in question.
________________