Lerp in Nested Coroutines doesn't work if I add some functions inside the Coroutines

Hi, I have a gameObject with some childs, and I need to move it forward, clear the childs, move back to original pos. The code I’m using is;

IEnumerator HidePrev ()
    {
        GameObject.Find("FileManager").GetComponent<FileManager>().lastPath = GameObject.Find("FileManager").GetComponent<FileManager>().curPath;
        GameObject.Find("FileManager").GetComponent<FileManager>().curPath = transform.name;

        float time = 0.0f;
        Vector3 endPos = new Vector3(0.0f, 0.0f, 100.0f);

        while (time < 1.0f)
        {
            time += Time.deltaTime;
            GameObject.FindWithTag("Folder").transform.position = Vector3.Slerp(GameObject.FindWithTag("Folder").transform.position, endPos, (time / 1.0f));
            yield return null;
        }
    }

    IEnumerator ShowNext ()
    {
        yield return StartCoroutine(HidePrev());

        //foreach (Transform child in GameObject.FindWithTag("Folder").transform)
        //{
        //    Destroy(child.gameObject);
        //}

        float time = 0.0f;
        Vector3 startPos = new Vector3(0.0f, 0.0f, 0.0f);

        while (time < 1.0f)
        {
            time += Time.deltaTime;
            GameObject.FindWithTag("Folder").transform.position = Vector3.Slerp(GameObject.FindWithTag("Folder").transform.position, startPos, (time / 1.0f));
            yield return null;
        }

        //GameObject.Find("FileManager").GetComponent<FileManager>().showFiles();
        //GameObject.Find("FileManager").GetComponent<FileManager>().showFolders();
    }

In this way it works, but if I uncomment the commented lines, the ShowNext coroutine doesn’t complete…
Any idea?

I think your code is runing at gameObject wtth tag “Folder”, and it destroys itself there:

foreach (Transform child in GameObject.FindWithTag("Folder").transform) {
	Destroy(child.gameObject); //destroy myself
}