How are you currently generating the login URL & handling the redirect?
You should simply be using wp_loginout
and passing the permalink as the redirect, and let WordPress handle everything else:
<?php wp_loginout( get_permalink() ) ?>
Or for a more custom implementation:
<?php if ( ! is_user_logged_in() ) : ?>
<a href="https://wordpress.stackexchange.com/questions/158728/<?php echo esc_url( wp_login_url( get_permalink() ) ) ?>">My custom log in text</a>
<?php endif ?>
If you still have issues, disable all plugins. It might also be worth posting the code you use to register the custom post type.