I think you're missing the whole point.
The Swedish prosecutor has failed to her their duty (as confirmed by the Swedish supreme court) to in refusing to accept Assanges statement from the UK/Ecuadorian embassy.
Had the prosecutor done her job Assanges case would have already gone through the courts, but now he has been unnecessarily detained (essentially in investigative custody, by whom isn't relevant here) for several years.
Edit: I'm not sure why this is getting downvotes, Sweden has already admitted that there's no need to have Assange in Sweden unless he's sentenced. Therefore forcing Assange to stay in the Embassy under the threat of (unnecessary) extradition to Sweden can undoubtedly be considered detainment.
Had the prosecutor done their job Assange would've been charged, got his trial and potentially (very likely, considering the evidence) found not guilty.
Of course, a guilty sentence would completely change the situation.