This makes sense for Toyota. Sales of all small cars are down and the old Yaris is about dead by the sales figures. Now there is plenty of confusion with two completely different cars being called Yaris, one of the (ahem) way better than the other. Simplify the lineup, get a consistent brand name item, and have a highly ranked sub compact without confusion. People won't mind the Mazda thing in general, especially when they drive it.
I wanted the Mazda hatch when I bought my 2019 Yaris sedan, but now just love the sedan. It will be cool to see both Mazda/Toyotas side by side next fall, yet both may vanish if they don't start selling. Corolla may become their only small car.Maybe having been picked as a 2019 Top Ten car by Consumer Reports will help it along.