Ending was neither surprising nor shocking (spoilers)
Don't get me wrong, I liked the movie. And I try to watch as many noir films as possible.
But the problem with all noir films from the classic period is that they were made in the days of the Production Code. And the Code stated all murderers must either a) get caught or b) get killed themselves.
Since Diane was acquitted in court, that left only one other option. And it wasn't too difficult to figure out how she would meet her demise.