Gallacher, right, who won the Hero Indian Open in his last outing, started the day just two shots off the lead after finishing birdie-albatross-birdie in the opening circuit to open with a 67.
However, the 44-year-old ended up in a battle to make the cut, making it through to the final two rounds by the skin of his teeth after a nine-over 82 as the afternoon starters were made to struggle in the Moroccan capital.
The four-time European Tour winner never really recovered from starting bogey-double bogey before dropping shots at the seventh and eighth. He followed another bogey at the tenth with his only birdie of the day at the par-4 11th, but then dropped four shots in three holes from the 14th.
The difficult day saw him drop 58 spots into a tie for 62nd on four-over, nine shots behind the joint leaders, American duo David Lipsky and Sean Crocker, after they carded 70 and 74 respectively.
On a day when only three players carded rounds in the 60s, Grant Forrest had a bogey-free 70 that lifted him into a tie for 16th on one-under alongside Marc Warren (73), with David Law (71) a shot behind.
Richie Ramsay, the 2015 winner but at a different venue, was the only other Scot to progress, picking up two shots in the final four holes in his 72 for three-over.
In the LET’s Lalla Meryem Cup, which is running concurrently at the same venue, Carly Booth maintained her recent good form to sit just outside the top 10 at the halfway stage. The Comrie woman carded a second-round 74 for a one-over total, a shot ahead of Kelsey Macdonald after her she signed for a 75.
As Spaniard Nuria Iturrios moved into the lead on seven-under, a shot ahead of first-round pacesetter Lina Boqvist from Sweden, Michele Thomson (three-over) and Kylie Henry (seven-over) also survived the cut.
l Scottish pair Grace Crawford (Gullane) and Carmen Griffiths (Aboyne) carded matching two-over-par 77s in the first round of the Girls Under-16s Open at Fulford.
In an event won last year by Broomieknowe’s Hannah Darling, Italian Francesca Fiorellini set the pace with a 71, a shot ahead of England’s Davina Xanh.
l Last year’s Ryder Cup was named “Event of the Year” at BT Sport Industry Awards in London. A record crowd of more than 270,000 fans watched Europe hammer the US at Le Golf National, with more than 22 billion social media impressions across week.