Rollback to stable is enhanced to bring back the checkpoint consistency by rollbacking the additional data according to the checkpoint snapshot. To achieve it, all the transaction ids that are written to the cells must be retained until the rollback to stable is finished.
There shouldn't be any existence of transaction ids after successful rollback to stable followed by a checkpoint, but if the page has any other updates with transaction ids and these are written as it is to the disk lead to them cause the data visibility problems.
To fix the data visibility problem, we cleared all the transaction ids present on the page whenever a page gets written to the disk during recovery, but clearing the transaction ids when rollback to stable is happening leads to the wrong rollback to stable operation as it doesn't find the required stable version in the history store.