Investigating about this I didn't really find a good solution to remove the BookVersions.Code.BookLibrarySheet while keeping the code to execute.
But maybe we could also just add this code on the top of the BookVersions.Code.BookLibrarySheet and it should fix the issue to show the correct page while the page is marked as deleted: