(I was trying to see if the Panic-button would trigger same hazard mode ... to make sure all the relays are working).
(Same as my 2017.5) it only flashes upfront. I'm guessing your hazard switch might have a bad solder joint.
Is your car still under warranty ? If not, you may try to remove (?) the small panel & check...
Could be the relay or fuse feeding power to the hazard switch on the dash. Double check your relay under the hood and/or fuse feeding power to the switch which may be located inside the car and separate from the relay.