A GameObject function in Start() doesn't let the next actions to be executed after it

Hi! I have a GameObject function in a Start() with the purpose of finding an object with a specific tag which is closest to the object which the script is referenced to. This is the Start() code from the script. Everything before “FindClosestIntersectionTarget” method is correctly executed; everything after it is like they don’t exist :

private void Start()
    {
        Player1 = GameObject.FindGameObjectWithTag("Player1");
        Player2 = GameObject.FindGameObjectWithTag("Player2");
        Player3 = GameObject.FindGameObjectWithTag("Player3");
        Player4 = GameObject.FindGameObjectWithTag("Player4");
        Arrow = GetComponent<Animator>();
        
        FindClosestIntersectionTarget(currentPathArrowManagerEgypt);

        pathArrowScript = currentPathArrowManagerEgypt.GetComponent<PathArrowManagerEgypt>();
        gameControllerObj = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameController>();
        switch (pathArrowScript.playerinIntersection)
        {
            case 1:
                SelectedPlayer = Player1;
                
                break;
            case 2:
                SelectedPlayer = Player2;
                
                break;
            case 3:
                SelectedPlayer = Player3;
                
                break;
            case 4:
                SelectedPlayer = Player4;
                
                break;
                
        }

    }

This is the code inside “FindClosestIntersectionTarget()” method:

GameObject FindClosestIntersectionTarget(GameObject currentPathArrowManagerEgypt)
    {
        Vector3 arrowPosition = transform.position;
        return GameObject.FindGameObjectsWithTag("PathArrowEgypt1")
            .OrderBy(o => (o.transform.position - arrowPosition).sqrMagnitude)
            .FirstOrDefault();
    }

As you can see, nothing special. There is something about GameObject functions which I’m overlooking?

Good day.

When a script gives an error like nullreference or something else, it normally stops running. So this can be the cause it does not execute the following lines of code. Make sure there is no error, or put some if - else to prevent code stops if does not get some return or something.

Bye!