I don't think that they're losing money, and contrary to popular belief, the Mini is not to blame for declining iPad sales. I recall relative sales figures of iPads being released for the holiday quarters of the last two years, and both times the Minis (2 and 4) actually accounted for more units sold than any of the Pro models. This was especially apparent in 2015 when the Mini 4 came out, showing that when Apple provides an update, and price it reasonably relative to other models, people will buy it. Granted, I'm sure the Minis don't enjoy the same profit margin per unit.
As I've mentioned in another thread, I think the really reason why the Mini is being neglected is because it doesn't fit Apple's narrative of the iPad being a laptop replacement. The Mini 4 is a really good tablet, and that's exactly what I want. It's not going to replace my laptop, nor can my phone replace it. But Apple is trying to get consumers to a place where all we have is a phone and an iPad.