Hello Mazdas 247.
I recently did a detailed write up on fitting CX-9 front calipers onto a 4th Gen Mazda3. You can find it on the mazda3revolution forum with pretty pictures and painting detail.
The gist of it is that you have to use 2014-2017 Nissan Rogue w/ 3rd row seating rotors, and add 2mm thick washers between the caliper bracket and the steering knuckle.
I'm reaching out to Mazda247 to put this rear brake breadcrumb out to more eyes:
The 4th gen Mazda3's use the "D" shaped two pin connector like the CX-9's, but Mazda redesigned the sealing faces internal to the connector and it does not directly work.
CX-9 connector on the left:

CX-9 connector on top:

The 4th gen's EPB side is a bit taller/longer and no matter how hard you push the CX-9 connector on, it just won't latch:

However, the 4th Gen connector may easily fit over the CX-9 rear brake caliper. Please update if you find out!
I recently did a detailed write up on fitting CX-9 front calipers onto a 4th Gen Mazda3. You can find it on the mazda3revolution forum with pretty pictures and painting detail.
The gist of it is that you have to use 2014-2017 Nissan Rogue w/ 3rd row seating rotors, and add 2mm thick washers between the caliper bracket and the steering knuckle.
I'm reaching out to Mazda247 to put this rear brake breadcrumb out to more eyes:
The 4th gen Mazda3's use the "D" shaped two pin connector like the CX-9's, but Mazda redesigned the sealing faces internal to the connector and it does not directly work.
CX-9 connector on the left:

CX-9 connector on top:

The 4th gen's EPB side is a bit taller/longer and no matter how hard you push the CX-9 connector on, it just won't latch:

However, the 4th Gen connector may easily fit over the CX-9 rear brake caliper. Please update if you find out!