It doesn't sound fluid related, but I believe mazda 3 atf is Mazda type M5 (used to be called Mazda M-V, which is NOT Mercon V or equivalent) and I don't think there are many that are M5 rated. Some were listed as Mazda M-V rated early on but then later that Mazda spec was not listed.
I used Mazda M5 and never had any trouble. My first change around 50k the fluid was almost black but actually tested fine. Color doesn't mean anything, unless the ATF also smells burnt (you'd know, burnt ATF smells bad). I've since changed again around 80k. Transmission shifts as it did right off the lot at 21 miles.
I hope you find out what happened, hopefully a gasket or ring didn't get loose in there.