Heap size error on "Load more" page versions

In the page builder of a particularly massive page, when I open the Versions popup, I get an apex heap size error if I try to sort the table or use the ‘load more’ feature.

Update: this seems to only happen after I’ve created a new pageversion.