I setup a test file with two investment accounts (Investment 1 and Investment 2) and one share investment (Share 1) - not very imaginative, I know
I added 10,000 to Investment 1 (cash) account on Nov 1
I entered a purchase transaction for 100 Share 1 at 10 in Investment 1 on Nov 2
I entered a Return of Capital transaction of 100 on Nov 3
I entered a transfer of 100 shares from Investment 1 to Investment 2 on Nov 4
I sold the 100 shares for 13.50 each from Investment 2 on Nov 5
Prior to the transfer, the cost basis went from 1,000 on Nov 2 to 900 on Nov 3
After the transfer, the cost basis reverted to 1000 on Nov 4
The gain on the sale was calculated as 350 (100 x 13.50 - 1,000) whereas it should be 450