...except Assange would have been transferred to America to stand trial over Wikileaks before he would even have a chance to stand trial over the rape accusations.
I don't think there was an extradition request from the US, was there? Only one from Sweden. And it's very unlikely that Sweden would extradite him to the US for this. They value the free press, but take rape very seriously.
The plan was to get him to the US all along, unless you want to believe it was a coincidence that Sweden kept up the request for ten years but dropped it the minute it got in the way of extradition to the US.
As to why Sweden, who knows why they thought that would be preferable. Maybe just to smear his reputation a bit, to soften the protest at the treatment they want to give him? Very successful if so.
But either way, you're talking about the people who forced down the Bolivian president's plane because they thought Snowden might be hiding in it. When they say "the law only matters when the outcome doesn't", this would be an example of a case where the outcome (stop Wikileaks) mattered.