I’ve only noticed “my bad” being used in the sense of "my mistake’ for the past year or two. It may have been in use for much longer, but since I don’t live in the U.S. I may have missed it.
Although it was around before then, I think the movie “Clueless” (in 1995) included it as a catch phrase that brought it to the general public. My guess is that it originated in urban English (ebonics).
I have used it for years. On fellow asked me if I played volleyball when he heard me say it once. It so happened I was a big volleyball freak at the time and Karch Kiraly was my hero. So of course I said “ummm yeah how’d you guess.” He said that term was used in volleyball but forgot where it originated specifically.