"Remove orphans" task fails to complete 4.1.3 + 4.2.0rc1

There’s been a similar report here: PulpDebClient::ApiError - HTTP 500 when running katello:delete_orphaned_content - #5 by rgp

FYI

ping @quba42 does this look familiar?