The "log in to add to basket" functionality cannot send you to the product, as it doesn't load a restricted page, it is simply a button to load the "Login" page. This works differently to the "send to calling page" function which is able to redirect you.
Perhaps the "log in to add to basket" button should have a parameter or attribute assigned that either redirects back to the product detail page, or adds it to the basket and loads the basket page.
Currently when a logged out user is browsing a product page and would like to 'add to basket' they are prompted to 'log in and add to basket', that prompt sets the user expectation. However that is not what happens this button click only logs the user in. It would seem like a no-brainer to add functionality that the prompt 'Log in and add to basket' suggests either A) Logs the user in, returns the user to their product page which will now show a prompt of 'add to basket' OR B) Logs the user in, returns the user to their basket with the product now added.