Spain forward Gerard Moreno came off the bench to snatch a 1-1 draw away to Switzerland in the Nations League on Saturday.
Ramos, who also became the most capped European player of all time, had scored all of his previous 25 penalties but was thwarted when Yann Sommer guessed the right way and repelled his spot kick in the 58th minute to preserve his side's lead.
Switzerland had taken the lead in the 23rd minute through Remo Frueler and could have doubled their advantage in the second half but Ramos came to his side's rescue with a goalline clearance.
Ramos set for PSG as Man Utd close in on Varane - Paper Round
- Werner double helps Germany to comeback win over Ukraine
- Kante sends France into Nations League Finals at expense of holders Portugal
Spain then earned a second penalty in the 79th which led to Swiss defender Nico Elvedi being sent off. However, Ramos was again outwitted by Sommer, who could not be fooled by the defender's chipped 'Panenka' penalty and caught the ball.
Substitute Moreno saved Ramos' blushes in the 89th minute, finally beating Sommer by lashing home a cross from Sergio Reguilon.
Germany lead Group A4 with nine points, while Spain are second with eight and must win Tuesday's showdown at home to Joachim Low's side in order to progress to the final four. Switzerland, meanwhile, were relegated to League B.
"Football is like this, it's a marvellous sport but sometimes it's very unfair," said Spain coach Luis Enrique.
"We were lacking a bit of freshness but I think we played well even though we couldn't do the most difficult thing, which is to score. We deserved to win for our first half performance and for how we played in the second."
Real to try and steal Barca target to replace Ramos? - Euro Papers
Hakimi completes his move to PSG on five-year contract
PSG close to Sergio Ramos transfer - Paper Round