If you add "X-Requested-With": "XMLHttpRequest" to your ajax request header the storePreviousURL() method will skip storing the url, and your redirect()->back() should start work as you expect again.
Read more here: https://codeigniter.com/user_guide/general/ajax.html