He has to step out of the embassy and enter the UK before he can go to Sweden.
A bunch of the newspapers here (the UK) looked into this at the time and the short version was there was no realistic, workable way of getting him out without the UK co-operating.
Contrary to popular belief, diplomatic missions do not
enjoy full extraterritorial status and are not sovereign
territory of the represented state. Rather, the premises
of diplomatic missions remain under the jurisdiction of
the host state while being afforded special privileges
(such as immunity from most local laws) by the Vienna
Convention on Diplomatic Relations.
[1]https://en.wikipedia.org/wiki/Diplomatic_mission#Extraterrit...