The difference in BlockAssembler::AddToBlock is explained by D2047:
the Bitcoin ABC codebase stores the CTransactionRef in a CBlockTemplateEntry struct, and copies it into the block later in BlockAssembler::CreateNewBlock
This is a backport of core#19283