You have to keep rolling until you (a) are healed, (b) roll a 20, or (c) fail three times (not necessarily in a row) and die.
If you fail, that means you are getting worse. If you don't fail, but don't roll a 20, then you have another round for someone to try to help you, but you haven't...