How to redirect users without permission to view content to a custom page?

Redirects and forced 404 are not that good for SEO, also might hurt user experience.

I recommend that you take this approach (if you’re code savvy):

<?php
//Your page template

//Check if user have permission
if ( $permission ) {

     //All your page/post content here
}

//Else user have no permission -> show him something else like notice
else {

    ?>
    <h1>You don't have permission to see that page.</h1>
    <a href="https://www.site.com/buy-access/">Press here to buy access!</a>

    <?php

    //Or whatever your page / bussiness model is
} ?>

Let me know if that’s approach works for you.