It's highly unusual for a grandparent to win custody over a fit parent.

I'm curious as to whether CPS/equivalent is involved.