Thanks for confirming @bug-or-feature - the confusion is caused by what I presume is a Demo env bug, where the transaction reference generated for a closed trade is only half the length of the typical deadId character length 🤦♂️.
Here's an example:
"date": "06/11/23",
"instrumentName": "FTSE 100 Cash (£10)",
"period": "-",
"profitAndLoss": "£25.00",
"transactionType": "DEAL",
"reference": "NR3HSJAP",
"openLevel": "7420",
"closeLevel": "7415",
"size": "-0.50",
"currency": "£",
"cashTransaction": false
The prefix of DIAAAAN was missing in this scenario and I couldn't in good faith presume it'd always be the same thus the confusion. Perhaps someone in the IG team could address how widespread this bug is.