Back a couple years ago when I was doing my 100 baby challenge, I often came across that glitch. What I was able to gather, it was from using CC on child female sims (it never effected my male child sims). I don't use cheats to take sims into CAS unless MC is considered a cheat in the games eyes, because I always only use MC CAS to change clothes/hairstyles.
I did find a solution, in the past, but with my age... memory isn't the best.
This time, I did try evict the household. At which point, the little girl was missing from the portrait. Then I couldn't put them back in a house. I didn't try saving them or bulldozing the lot (wish I had thought of that). I ended up just reverting back to a older save (How I save is: Save as Same name with either A, B, C, or D at the end. That gives me four older saves to go to if glitches occur and if I'm trying something different that I might not like or want the results I use A1, B1, C1,D1 etc), then the day before her birthday I took her in CAS with MC and turned her into a teen. Since, when she was glitched, there was no way to take her in CAS... neither thru MC or cheats.
If I happen to remember what I did, or if it happens again (cause I worry with her YA birthday coming up in a couple days) and I find a solution, I'll post it here.