Session variable get lost after redirect

I have an issue with session variable getting lost upon redirecting user to a third party website and then getting back at me. I made a simpler version of the error to make it reproductible:

            if($request->getSession()->get('session_variable') == 'made'){
                //I do some stuff           
            }else{
                $request->getSession()->set('session_variable','made');

                $request->getSession()->save();
                //tried adding this but it doesnt change anything 

                $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
                return $this->redirect($actual_link);
            }

So this piece of code should, In my understanding get in the else once, set the session variable and then get out of the loop.
The thing is that the code keeps on looping on the else loop forever

I get the request paramter from the webservice:

    public function myWebService(Request $request, $otherParam){
...

I’m using Symfony 6 and php 8

Strange fact that I can hardly understand: sometimes the problem will not happend. Same initial url