The code in bt_debug.c that prints history store entries for a key sets WT_CURSTD_HS_READ_COMMITTED to see "everything", but this still excludes obsolete entries (those with a visible_all stop time). The visible_all check doesn't work properly if the tree is a checkpoint tree, so as an expedient use WT_CURSTD_HS_READ_ALL for checkpoint trees.
This is doubtless why I was seeing obsolete history store entries in page dumps while looking at a different problem a couple weeks ago.
WT-9439 there's an assertion in the visibility code that fires on these kinds of issues, and it's recently been observed a few times to fire during page dumps. The visible_all check is why, and this change makes that not happen.
For the record: the "right" way to fix this is to substitute the whole checkpoint cursor context into the session when dumping pages from a checkpoint cursor. However, the code to do that is private to cur_file.c, and it doesn't seem worthwhile to move it just to avoid seeing obsolete history store entries in debug dumps. (And pasting a second copy of it would clearly be worse.)