Tomljanovic was one set up over the 18-year-old and had broken her serve in the second when a medical timeout was called.
An on-court doctor could be heard requesting the timeout for Raducanu. The All England Lawn and Tennis club later confirmed in a statement that Raducanu retired due to "difficulty breathing."
"I'm actually really shocked. Emma must be really hurt if she retired," Tomljanovic said in her on-court interview at the end of the match.
"To play as a Brit at home it is unbelievable. I'm really sorry for her as I wish we could have finished it. It's sport and I'm really wishing her all the best.
"I think the beginning was really nervous on both sides but by the end of that first set we were both playing really good tennis."
Raducanu, who was a wild card entry to the tournament, was having a fairy tale run at Wimbledon having impressed to make it to the second week.
A-Level exams and the COVID-19 pandemic meant that Raducanu has not played much tennis in recent months. She made her WTA tour debut in June and is ranked No. 338 in the world.
The young player was Britain's final hope of a champion in both the men's and the women's singles.
Instead, Tomljanovic will meet fellow Australian and world No. 1 Barty, who beat French Open single and doubles winner Barbora Krejcikova 7-5, 6-3 earlier in the day.
"To play Ash and have one of us go to the semis is great," Tomljanovic added. "I'm thrilled to play Ash and hope it will be a good match."