One of your switches, most likely the one that you flip twice to get the light back on again, is either dying or has a loose wire. I would do the following on both switches, since they are likely similar age and same installation type:
- Turn off the breaker
- Remove the cover plate
- Unscrew the switch from the box and pull it out
- Take pictures of all wires going into the switch - that way if there is confusion later you know how it was originally connected
- If there are wires in "backstab" connections, remove them from the backstabs and connect them to the matching screw connections. If this is the case, it is almost definitely the problem.
- If there are any loose wires in screw connections, redo the connections
If after doing this and putting everything back together you still have problems then the switches themselves may be starting to fail. That can happen. Replace with good quality switches. For example, looking at Leviton (a major brand) at Home Depot online, they have basic white 3-way toggle switches for $2.37 and "commercial grade" for $3.63. The "commercial grade" has a 10-year warranty instead of a 2-year warranty (a warranty on this is nearly meaningless as except for DOA it won't be worth tracking down the receipt to deal with the warranty, but it is an indication of quality) and "External clamp-type wiring terminals provides secure connection of solid or stranded wire for back or side wiring" which is better than the cheaper "Quick wire push-in and side wired". The key is that an extra $1.26 per switch really doesn't matter for a pair of replacement switches. It does matter for a builder installing dozens of switches in a bunch of houses. So spend a little extra for better quality and you will avoid future problems.
Specifically with 3-way switches, there are two different types of connections (besides ground). There are two "traveler" connections, typically brass colored screws. There is one "common" connection, typically black colored screw. But the colors and locations (top left, bottom left, top right, bottom right) can vary by brand and by model. Plus the wire colors vary depending on a number of factors. So pictures of the old switches before disconnecting wires is crucial to getting replacements connected properly.