Don’t know if you stll need this info, but:
If you get tx.ids from the RPC (node) than you have to reverse those.
When you create the coinbase and double sha256 it you MUST NOT reverse it.
So, when you have the hash256 (double sha256) of the coinbase and you reversed the tx.ids you get from RPC, you can calculate the merkle root.
Same result is done by creating merkle branches: when you reversed the tx.ids got from the node with RPC, you can create merkle branches (aka steps in some sources) and put the coinbase hash256 as the first input when calculate the merkle root (in some sources this the function is called “with_first(coinbase, steps)”). This will recreate the same merkle root as it would be generated by starting with leaves (TXIDs hash256).











