A Haris Seferovic strike and Shane Duffy's own goal left the Republic of Ireland needing to beat Denmark to secure automatic qualification for the Euro 2020 finals as Switzerland got right back into the race.
Seferovic's 16th-minute effort and Duffy's misfortune at the death secured a 2-0 win for the home side at the Stade de Geneva on a night when skipper Seamus Coleman was sent off for two bookable offences.
Had it not been for keeper Darren Randolph, who saved Ricardo Rodriguez's second-half penalty after denying Seferovic a second with a smart save, and the post which kept out a Fabian Schar header, the Swiss might have won much more comfortably with Ireland rarely looking like claiming the victory which would have booked their place at next summer's finals.
Even a first start for teenager Aaron Connolly did not provide the spark required as Mick McCarthy repeatedly tinkered with both his system and personnel in an ultimately vain battle for a foothold in the game.
The pitch, which had passed an inspection around two hours before kick-off after torrential rain throughout the day, proved sticky as they sides set about their business, but the Swiss made the better start with Granit Xhaka forcing a seventh-minute save from Randolph after taking aim from distance.
Ireland's efforts to work their way into the game stalled time and time again as they wasted possession at regular intervals, and they were made to pay with 16 minutes gone when Seferovic latched on to a half-clearance, took a touch and then fired across Randolph and inside the far post to open the scoring.
The Swiss were in complete control with the visitors penned back deep inside their own half seemingly incapable of picking out a team-mate on the rare occasions they did have the ball, and although they finally started to make a limited impression, they almost conceded again eight minutes before the break.
Newcastle defender Schar, who scored his side's goal in last month's 1-1 draw in Dublin, curled a long-range left-foot shot just wide with Randolph struggling to make his ground.
It took the Republic, who had switched to a 4-1-4-1 system from their initial 3-5-2 in a bid to stem the flow, 41 minutes to put Swiss keeper Yann Sommer under any pressure, although he was relieved to see Duffy's powerful header nestle into his midriff after he had met Glenn Whelan's corner.
Having conducted a series of first-half reshuffles, McCarthy opted for change at the break when he replaced striker James Collins with midfielder Callum O'Dowda and switched to 4-3-3, but it took a fine reaction save by Randolph to keep out Seferovic's flicked header from Ricardo Rodriguez's inswinging 52nd-minute free-kick.
Ireland belatedly flexed their muscles as they saw ambitious penalty appeals for Schar's challenge on Connolly waved away before central defender John Egan drilled a long-range shot wide, but Randolph needed the help of his far post to keep out Schar's 62nd-minute header.
Connolly's evening came to an end with 20 minutes remaining when he was replaced by the more physical Scott Hogan, but he was swiftly joined in the dressing room by Coleman, after he had been adjudged to have blocked Breel Embolo's shot with his arm inside the penalty area and was given a second yellow card having already been booked following a first-half pushing match with Xhaka.
Randolph got down superbly to turn Rodriguez's spot-kick on to the post to keep Ireland's faint hopes alive, but there was nothing Duffy could do to keep out substitute Edimilson Fernandes' goal-bound effort with the final kick of the game.