Mohamed M. answered 01/21/20
Arabic Instructor with 18+ years of teaching experience
ثكلتك أمك literally= May your mother mourn you
الثواكل = mourners. specially female meaning anyone who mourns or would mourn you
IT's a way of saying that you made or making a grave and fatal mistake, that you're as good as dead.
Sometimes it is used literally , but more often than not as an idiom/allegorical, to admonish as you say
I don't think we know who first used it. too ancient to find out. been used since before written history