Awer Mabil's equaliser forced extra-time
Raphael Onyedika side-footed home the crucial blow three minutes into the added period after Callum McGregor's stunning volley had put Celtic in front for the second time in the tie.
But defensive frailties cost them again as Awer Mabil levelled before Onyedika pounced to leave Celtic floored and bound for the Europa League.
They will face Czech side FK Jablonec in the third qualifying round next week, while Midtjylland go on to face PSV Eindhoven in European football's premier competition.
The result emphasises the scale of the task facing Ange Postecoglou as he attempts to rebuild a lightweight squad.
Celtic's pre-season has been dominated by talk from fans, pundits, and Postecoglou himself, about the lack of signings, with quarantine also denying them the services of recruits Carl Starfelt and Kyogo Furuhashi.
The fact they lined up with a defence with an average age of 21 told its own story, and the manager said it best this week when he referred to the team "flying by the seat of its pants".
But as in Glasgow last week they looked the more assured side in the first half, and McGregor provided the spark his team were searching for just two minutes into the second period as he took the ball on his chest before hooking it into the top right-hand corner.
The goal oozed class and gave Celtic the platform to kick on, and substitute James Forrest came so close to bolstering their advantage on the hour mark as he slid the ball wide after a good run.
And, just as in the first leg when Edouard passed up a one-on-one, they were punished for their profligacy. Midtjylland had not registered a shot by this point, but within two minutes of Forrest's effort, Mabil levelled.
The Australia international ghosted between Dane Murray and Greg Taylor to nod home a floated cross, emphasising the inexperience of the Celtic backline and the general anxiety which has surrounded the team in the last 12 months.
That only swelled from that moment on as the Danish side - roared on by about 6,000 of their fans - grew in confidence, and Victor Lind missed a golden chance to win the tie in stoppage time as he evaded 18-year-old Murray.
But Celtic were made to pay soon after as Evander floated in another delivery, which Henrik Dalsgaard steered into Onyedika's path, and the Nigerian had time to take a touch and dispatch from six yards out.
The Midtjylland number 10 was a danger with his quality delivery
Celtic are as far away from being a Champions League group-stage club as they have been in a long time. Despite their decade of dominance in Scotland, they have drifted further from Europe's elite with every passing season.
It is fair to analyse the performance on the pitch, but only in the inescapable context of the squad Postecoglou has to work with.
To begin a Champions League qualifying campaign with a centre-back pairing aged 18 and 21, no clear first-choice full-backs or goalkeeper, and a striker in Edouard who clearly sees his future elsewhere is scarcely believable in the eyes of most Celtic fans. And that isn't even the full extent of their problems.
The club has no head of recruitment, no sporting director and are attempting their largest rebuild in two decades. Postecoglou says he walked into this job with his eyes wide open, and he will largely receive a pass in the circumstances, but with each passing game the scale of the challenge grows.
Across both legs there were signs of his high pressing, vertical style, but the Australian needs both time and signings to have any hope of success in the short to medium term. It's sure to be a bumpy ride.
Celtic manager Ange Postecoglou: "We just got tired in the end. They scored and got through it. I thought my players gave their maximum. It's the beginning of what we're trying to embark on. We controlled the game until they scored."