Wales' hopes of reaching a first major tournament came to an agonising end as Switzerland fought back to win a dramatic World Cup play-off final in the dying seconds of extra time.
Rhiannon Roberts put Wales ahead but Ramona Bachmann levelled.
Ana-Maria Crnogorcevic then missed a penalty before converting the rebound, only for that to be disallowed.
Bachmann also saw a goal ruled out after a VAR check before Fabienne Humm won it right at the end.
With a penalty shootout looming, Humm's delicate near-post finish meant a painful conclusion to a fine campaign for Wales.
Victory would have put Gemma Grainger's side within sight of the 2023 World Cup, but instead they are left licking their wounds after a valiant rearguard effort counted for nothing.
Grainger will point to the progress made during her first qualifying campaign as manager, with Wales finishing second in Group I to runaway winners France before beating Bosnia-Herzgovina in last week's play-off semi-final.
But Switzerland were the better side in the play-off final and, while the timing of Humm's winner was difficult to take, Wales could not complain about their defeat.
Switzerland justified their pre-match billing as favourites against a Wales side who are ranked 30th in the world by Fifa, nine places below their hosts, though Nils Nielsen's team were made to work for their victory.
The Swiss went to last summer's European Championship - their third major tournament in the last seven years - whereas Wales have never previously made it as far as the play-off stage of qualification.
Wales eventually got the better of Bosnia-Herzegovina courtesy of Jess Fishlock's extra-time goal, and there was no surprise as Grainger named an unchanged team.
They had to cope with early pressure in Zurich, with Switzerland asking questions of a Welsh defence which had last been breached by France in April.
Rhiannon Roberts (centre) celebrates after scoring just her second goal for WalesThere was a scare when a half-cleared set-piece dropped to Viola Calligaris 25 yards from goal, and her skidding drive kissed the outside of Laura O'Sullivan's post.
Wales gradually grew into the contest - and snatched the lead through their first opportunity of any note.
Angharad James' corner was not dealt with by the Swiss defence, giving Kayleigh Green the chance to head the ball into Roberts' path.
The Liverpool full-back's task was simple, as she rolled the ball beyond a helpless Gaelle Thalmann.
Wales were in dreamland, their pockets of fans at Stadion Letzigrund sensing something special was on the cards as Grainger's team defended their lead with relative comfort for a while.
Yet the mood changed just before the break, when Lia Walti spotted a gap in the Welsh rearguard and rolled a perfect pass down the right flank for her Arsenal team-mate Noelle Maritz.
Her pull-back picked out Bachmann, whose crisp shot flashed past O'Sullivan and into the net.
Switzerland carried momentum into the second half, and thought they were ahead after a penalty was awarded against Rachel Rowe for handball.
Rowe appeared to have dealt with Eseosa Aigbogun's cross only for Swedish referee Tess Olofsson to give the spot-kick after a lengthy look at the VAR monitor.
Barcelona's Crnogorcevic fired the penalty against the base of the post before sweeping in the rebound.
But Swiss celebrations were halted by Olofsson, who rightly ruled the goal out because no other player had touched the ball between Crnogorcevic's two efforts.
Switzerland celebrate after former Chelsea player Ramona Bachmann's equaliserWales were off the hook.
The visitors carved a rare chance as Fishlock found Green in the area but her effort looped over.
Then, six minutes from the end of normal time, came the second major intervention from Dutch VAR Jochem Kamphuis.
Bachmann thought she had scored her second as she turned sharply in the area and found the far corner - but the goal was eventually ruled out for a marginal offside in the lead-up against substitute Riola Xhemaili.
For a moment Wales looked beaten, yet they wriggled off the hook for a second time.
Having dug deep to force extra time, Wales had to delve further into the reserves as Switzerland dominated the additional period.
Bachmann danced round a couple of challenges only to shoot too close to O'Sullivan, before Crnogorcevic headed narrowly wide and Rachel Rinast volleyed the wrong side of the post.
Xhemaili then came close to finding a winner only for her header to be headed off the line by Rachel Rowe.
With that an epic contest seemed sure to be decided by a shootout, but Switzerland carved one final opportunity.
Geraldine Reuteler made ground down the left and crossed for substitute Humm to deliver the game's decisive blow.
Line-ups
Switzerland
Formation 4-1-4-1
1Thalmann
5Maritz18Calligaris15Bühler19Aigbogun
13Wälti
9Crnogorcevic6Reuteler10Bachmann11Sow
17Fölmli
1Thalmann5Maritz18Calligaris15Bühler19AigbogunSubstituted forHummat 105'minutes13Wälti9Crnogorcevic6Reuteler10BachmannBooked at 85minsSubstituted forTerchounat 113'minutes11SowSubstituted forXhemailiat 75'minutes17FölmliSubstituted forRinastat 87'minutesBooked at 117minsSubstitutes
2Stierli3Piubel4Rinast7Xhemaili8Felber12Peng14Rey16Mauron20Humm21Herzog22Riesen23TerchounWales
Formation 4-1-4-1
1O'Sullivan
5Roberts14Ladd3Evans13Rowe
4Ingle
18Holland8James10Fishlock20Jones
9Green
1O'Sullivan5Roberts14Ladd3Evans13RoweBooked at 56mins4Ingle18HollandSubstituted forWardat 119'minutes8James10Fishlock20JonesSubstituted forMorganat 69'minutes9GreenSubstituted forWoodhamat 90'minutesBooked at 99minsSubstitutes
2Woodham6Green7Ward11Bull12Clark15Hughes16Estcourt17Walters19Wynne21Middleton-Patel22Filbey23MorganLive Text
Match ends, Switzerland Women 2, Wales Women 1.
Second Half Extra Time ends, Switzerland Women 2, Wales Women 1.
Hand ball by Riola Xhemaili (Switzerland Women).
Goal! Switzerland Women 2, Wales Women 1. Fabienne Humm (Switzerland Women) right footed shot from the left side of the six yard box to the bottom left corner. Assisted by Géraldine Reuteler with a cross.
Substitution, Wales Women. Helen Ward replaces Ceri Holland.
Rachel Rinast (Switzerland Women) is shown the yellow card for a bad foul.
Foul by Rachel Rinast (Switzerland Women).
Ffion Morgan (Wales Women) wins a free kick on the right wing.
Attempt missed. Rachel Rinast (Switzerland Women) right footed shot from the right side of the box misses to the right following a corner.
Attempt blocked. Riola Xhemaili (Switzerland Women) header from very close range is blocked. Assisted by Rachel Rinast with a cross.
Corner, Switzerland Women. Conceded by Ceri Holland.
Corner, Switzerland Women. Conceded by Lily Woodham.
Attempt blocked. Géraldine Reuteler (Switzerland Women) left footed shot from the centre of the box is blocked.
Attempt blocked. Ana-Maria Crnogorcevic (Switzerland Women) right footed shot from the centre of the box is blocked.
Corner, Switzerland Women. Conceded by Hayley Ladd.
Substitution, Switzerland Women. Meriame Terchoun replaces Ramona Bachmann.
Corner, Wales Women. Conceded by Noëlle Maritz.
Foul by Fabienne Humm (Switzerland Women).
Ceri Holland (Wales Women) wins a free kick on the right wing.
Corner, Wales Women. Conceded by Luana Bühler.