In Alice in Wonderland, the Queen of Hearts said during a trial, "Sentence first, verdict afterwards." Are there any common law countries where this could be legal? Could the judge say "This is the sentence if the defendant is convicted" before the jury reached a verdict? I don't see how it would be a due process violation, because the defendant has still been convicted by a jury and sentenced by a judge, just in the "wrong" order.
Things are just not done that way
This was intended as an absurdity. It was funny precisely because no real trial could operate in this way. Legal processes were one of the subjects that Carrol liked to poke fun at. In addition to the trial of the Knave of Hearts there is the short verse known as "The Mouse's Tale" in chapter two, which reads:
Fury said to a mouse, that he met in the house, 'Let us both go to law: I will prosecute you - Come, I'll take no denial; We must have a trial: For really this morning I've nothing to do.' Said the mouse to the cur, 'Such a trial, dear Sir, with no jury or judge, would be wasting our breath.' 'I'll be judge, I'll be jury,' Said cunning old Fury: 'I'll try the whole cause, and condemn you to death.'
As to a real trial, there is surely no common-law jurisdiction where the sentence, or even the possible sentence, is announced before the verdict. It is true that in some cases the penalty for a conviction is fixed, or lies within a very narrow range, by statute. But technically, such an appointed penalty is not a sentence until it is formally imposed after a guilty verdict. And the penalty, or range of penalties, that would follow a guilty verdict is not announced before the trial, although it might be known to many participants.