This seems weird this is a thing. Why would it not just sign them out and keep them on the page they are at?
Is there a way to just log them out and keep them on the page they are on? That weird "you will be redirected to the homepage in 5 seconds" seems like a poor UX
Override the logout phtml template and update the redirect url.
vendor/magento/module-customer/view/frontend/templates/logout.phtml:14
Change the $block->getUrl() to the url where you want to be redirected.
$($.mage.redirect("<?php /* @escapeNotVerified */ echo $block->getUrl() ?>", "assign", 5000));