The meaning is the same, but there is just a slight shift in emphasis. The sentence starting with the prepositional phrases puts more emphasis on the confrontation, so the meaning is closer to, "He didn't confess
even when he was confronted by the police with all the accusations."
On the other hand, the sentence starting with the subject is more easily understood.
Put a comma after the series of prepositional phrases and before the subject:
by the police COMMA he didn't confess
Note that adding "by the police" to the sentence introduces a new complication: multiple prepositional phrases in a string.
When you have a series of prepositional phrases, often each modifes the object of the preceding one,
-- "a crack in the shell of an egg in a nest on a branch of a tree in a forest in the mountains of the continental divide."
When several phrases modify the same word,
-- "the woman with the baby"
-- "the woman in the hospital"
it isn't possible to put both immediately following the word they modify, and one must select an order to put the phrases in.
-- "the woman with the baby in the hospital"
sounds like it is the baby in the hospital.
-- "the woman in the hospital with the baby"
is better. One would not typically identify a hospital by saying "the hospital with the baby"; it would be phrased "the hospital where the baby is" or something of the sort. Your listener will assume "with the baby" refers back to the woman.
Going back to your sentence, there are two possible orders, each with a possible misinterpretation.
-- "When confronted with all the accusations by the police": the prepositional phrase
by the police could modify
accusations; that is, someone confronted him with accusations made by the police. This is a plausible scenario.
-- "When confronted by the police with all the accusations": the prepositional phrase
with ... could modify
police; that is, he was confronted by the police who had the accusations instead of some other police. This sounds a little peculiar.
Thus, with the first order, the interpretation could reasonably go either way. With the second order, the listener is more likely to dismiss the alternative interpretation in favor of the one you intend.
Picking the order least subject to misinterpretion is a fine art, even for native speakers. Sometimes all possible orders are unsatisfactory. In that case one rearranges the sentence to change one or more prepositional phrases into something else: "When the police confronted him with all the accusations, he didn't confess."