Gagnon, from Lac-Etchemin, Que., sat fourth after the first run and was just four one-hundredths of a second off the lead near the end of her second run when she went down on her inside ski and did not finish.
"I'm just really disappointed," said Gagnon. "It's such a disappointment to see a fourth place or a podium go away. I left it on the hill today."
Gagnon, Canada's only true alpine all-rounder, has had a podium in slalom and looked ready to make the breakthrough in giant slalom on Sunday.
"Four gates from the finish. Can you believe it? She was either going to finish third or fourth," said Hugues Ansermoz, head coach of Canada's ladies' team. "She wanted to win. She didn't want to just finish, she wanted to move ahead and she attacked — she took chances.
"She fell four gates from the end and I was right there, right there. She showed again today that she has the speed. That was one of the toughest ones I've had to watch when you're standing right there on the side of the hill."
France's Tessa Worley took the win with a two-run combined time of two minutes 7.62 seconds, while Sweden's Jessica Lindell-Vikarby was second (2:07.99) and Solvenia's Tina Maze was third (2:08.41).
Gagnon's career-best giant slalom World Cup result is a fifth-place finish, also in St. Moritz, in 2010. After finishing fourth at the end of her first run Sunday, she was within a few hundredths of a second of Maze throughout her second run. Gagnon took a straight line into the gate where she went out.
"I think it was a miscommunication over the direction I needed to take but we are learning at every race," said Gagnon, who was the first Canadian alpine skier to pre-qualify for nomination to Canada's team for the 2014 Sochi Olympic Winter Games.
Prefontaine still needs a top-12 to secure her place on the Canadian Olympic team. She clocked a two-run combined time of 2:10.51 on Sunday.
"MP had a good first run," said Ansermoz, who was 17th after the first run. "She didn't start well but she was good in every section after that. In the second run she was doing fine but made a mistake."
Erin Mielzynski, of Collingwood, Ont., started 58th and finished 43rd after the first run. Mikaela Tommy, of Wakefield, Que., was 45th after the first run. Only the top 32 advance to the second run.
American Lindey Vonn skipped the St. Moritz meeting as she manages a right knee injury ahead of the Sochi Olympics. She plans to return in a downhill next weekend at Val d'Isere, France.