Huh. Your mom’s answer is strange. Really, really strange. If that was really their concern, they should have asked that question (what are your plans for who will care for your daughter if something happens to you) rather than the question they did ask. Which raises the question, unfortunately, if they think you might harm yourself… If they have no reason to think that, then perhaps your parental home is no longer (or was never) a good environment and it’s time to really work hard on getting out.
In many legal systems, father takes precedence over grandparents unless and even sometimes over other arrangements put in place. It doesn’t matter if he’s the shitty parent of doom, he’s a closer relative. Given that in fact people have this custom of up and dying (anybody could have a heart attack or be in a car crash) it may be a good idea to set up a legal arrangement designating your mother as your child’s custodian in case of death or inabilitation on your part.
Has your daughter’s father legally relinquished his parental rights? If not, pretty sure father trumps grandparents, as next of kin, and right of custody. While he may not currently play a role, if something were to happen to you, he may suddenly feel very paternal and want to step in. Your mother is right to be concerned.
ETA: WRT to legal issues, you hope for the best, but plan for the worst.
Please do not take any custody advice from the internet.
Sometimes letting the grandparents take over works out just fine:
I vote Jimmy. Put another way, if you have any concerns about custody, please find an actual, live expert person in your area who can advise you.
This!!!
Don’t give up your parental rights unless you absolutely think you will never be able to care for your child. Take the time off if you need it and have your daughter live with grandma for awhile while you get yourself back in shape. There is no shame in that and it will make it easier to pick things up where you left off with daughter.