However Mr Khan was unable to accept due to “logistical” difficulties with an already packed schedule and because their home near Santa Barbara was a 90-minute drive from where the City Hall-organised party was being held in West Hollywood.
It is also likely the mayor would not have wanted to be drawn into the royal family’s “civil war”, especially ahead of meeting Prince William at the FA Cup final last Saturday and the Queen’s visit to Crossrail on Tuesday.
Mr Khan has a good relationship with the Duke of Cambridge who he has met on several occasions.
They have a shared interest in tackling environmental issues.
Harry and Meghan, who stepped back as senior royals in 2020 and relinquished their role as working members of the royal family last year, sent three aides to the mayor’s rooftop party.
They included James Holt, who was head of communications for Nick Clegg when the then Lib-Dem leader was Deputy Prime Minister.
Mr Holt is now executive director of the Archewell Foundation, the couple’s charity.
A spokeswoman for the Archewell Foundation, when contacted by the Standard this week, did not deny the couple had been invited to the party nor that a return invitation had been extended to the mayor.
The party was held at Holloway House, the West Hollywood offshoot of the Soho House group of private members’ clubs.
Mr Khan met James Corden and film director Richard Curtis, and a host of ex-pat Brits working in the film industry.
The event was preceded by a “power roundtable” between Mr Khan and executives from Apple, Netflix, Universal, Disney, Paramount, Sony, 20th Century, HBO and Warner Bros.
This was described by Justine Simons, London’s deputy mayor for culture, as an “unprecedented gathering of [the] world’s top studios”.
Ms Simons had flown out to LA for the event, on Wednesday last week, and returned to London with Mr Khan the following day, after posing with the mayor for pictures as he toured Universal studios.
The mayor’s five-day trip was heavily focused on attracting US tourists back to London.
He made repeated mentions of the Platinum Jubilee and the UK’s royal history as a reason to visit.
He met Hillary Clinton and Mike Bloomberg in New York but had to abandon hopes of a meeting with Arnold Schwarzenegger, because the Terminator and former California governor was not in LA at the time.
Harry and Meghan, who celebrated their fourth wedding anniversary on Thursday, are due to return to the UK for the jubilee celebrations, which start in less than a fortnight.
On Thursday it was reported that they are filming a Netflix docu-series.
Mr Khan told the Standard this week how thrilled he was to have the Queen make a surprise visit to officially unveil the Elizabeth line, which is named in her honour.
Last Saturday he was seen celebrating beside the royal box at Wembley after his team Liverpool defeated Chelsea to win the FA Cup, which was presented by Prince William.