Louis is telling his story from a condemned cell. He has carried out his plan and killed the D'Ascoyne heirs who stood between him and the dukedom, and he has become the Duke of Chalfont. The irony is that he is sentenced to hang for the one murder he did not commit. That charge comes about through his entanglement with Sibella.
Sibella can save him, and a last-minute reversal sets him free. Then comes the twist the whole film has been building towards: in his hurry to leave, Louis realises he has left his memoirs, a full written confession, in the cell. The British version ends on that realisation, so it stays ambiguous whether he will be exposed.
The American version added a scene in which the memoirs are found. The reason was that the Production Code did not allow crime to pay. Seen afterwards, the framing device becomes the trap: Louis's vanity and his need to be admired as an artist of murder are what destroy him. His style, which carried him to the top, turns out to be his fatal flaw.