In Chinese, calling someone your ancestor in a dramatic or exasperated tone is a comedic and exaggerated expression of submission, frustration, or power imbalance, especially when dealing with a younger person (like a child or grandchild) who is being overly difficult, willful, or hard to handle.
In traditional Chinese culture, ancestors are sacred and occupy the highest level of respect in the family hierarchy. People burn incense to them, honor them, and never disobey them. So when someone refers to another person (especially a child) as their ancestor, they're ironically acknowledging how much deference and effort they're having to show—almost as if they're worshipping them.
In everyday modern Chinese, especially in a joking or exasperated context, you'll hear parents, grandparents, or even teachers say things like:
"哎呀,我的小祖宗啊!" (Aiyah, my little ancestor!)
"你就是我的祖宗!" (You're my ancestor!)
This is often used when someone is being a handful: fussy, spoiled, or unexpectedly dominant in the interaction.
It means: You're so much trouble that I have to treat you like you're above me.