7 year old negative talk

I have a 7 year old daughter who just had about a 30 minute meltdown saying some really negative things about herself. She was telling me she’s nothing and it’s like looking at a wall when looking at her, she doesn’t know anything, she can’t do anything, acting as if no one cares about her. During this time I was reassuring her and reminding her of everything she is and all the things she can do while holding her and crying with her. I tried to hold it back but it really hurt hearing these things from her. She said she didn’t have a heart after I told her how big her heart was and how caring she was.

This all started after getting frustrated with homework. I tried to let her have a break and breath and we would come back to it but she was being very disrespectful to me, mocking me and acting as if she didn’t care about it. I made her sit down after this and not speak at all and think about the things she was saying and doing. Since kindergarten we have been having issues with not being able to focus. She’s in therapy now and has been for about 2 months.

I guess I’m just wondering if anyone else has experienced their child talking negatively about theirselves. She snapped out of it saying I am everything! And naming off the people who do care about her and the things she can do while crying. She said why did I say those things about myself and then said she was just mad at herself and at the time didn’t care about anything.