Yikes,
I can't say that I have been in such a situation myself, as I am not a father. But the example of your oldest child speaks volumes. If those changes happened, then it does suggest that she is far better of with you than with her mom - and if you bring it to the judges that will definitely count for you

.
Mom wanted her back last X-mas? How did your daughter react to that?
I have the awful impression that the ex thinks the world and the family revolves around her. When that is not the case. Anyone can make a mistake - but she seems to prefer to carry on on the same track, when it is not such a good track.
Careful, though. She may actually straighten up her act, in order to prevent losing the case - or in an attempt to settle it.
And welcome to the site

.