How can I say Apple is in trouble when it’s selling 10 iPhones per second? This is a company that just recorded quarterly revenue of $88.3 billion, an increase of 13% from a year earlier and an all-time record. That led to a whopping quarterly profit of $20.1 billion. So how can I diss success like that? Easily. Apple has fundamental problems that could stop those billions from rolling in.

For starters, sales of Apple’s top-of-the-line smartphone, the iPhone X, have been lagging. KGI Securities‘ Apple analyst Ming-Chi Kuo, a.k.a. “The Most Accurate Apple Analyst in the World,” believes Apple will kill off its $1,000 phone because of weaker-than-expected sales.

In the short run, Apple appears to be pulling back from the iPhone X already. Samsung Display , which makes a cool $110 for the screen on every iPhone X sold, has slowed down its organic light-emitting diode (OLED) production because of “dull iPhone X” sales.

According to other reports, “Apple will slash its production target for the iPhone X in the three-month period from January by half from the more than 40 million units envisaged at the time of its release in November.” Kuo doesn’t even expect Apple to continue selling iPhone Xs. He expects the company to kill the line off.

Why? Most analysts give two reasons. First, Kuo finds that the Chinese market doesn’t love the iPhone X because the sensor notch reduces the apparent size of the display. The other reason is that while there were many people who were willing to pay a grand for an iPhone, there weren’t as many as Apple had hoped there would be.

I have some other reasons.

First, I think some people who can afford to spend $1,000 on a phone finally realized after the phone-slowdown brouhaha that Apple is ripping them off . The way Apple deliberately slowed down older iPhones without users’ knowledge didn’t sit well with a lot of people. If you feel as if you’ve been a loyal customer who has been deceived, a cheap battery replacement won’t salve the wound.

Second, even the most loyal Apple fanboi knows that iOS is a mess, with iOS 11.x plagued by one bug after another.

The latest bug is a doozy. if you really, really hate an iPhone user, just send your nemesis an instant message or email that contains a couple of symbols from the south Indian language Telugu, and it will crash the iPhone — hard. How hard? A lot of the time, we’re talking reset-your-phone hard. You know, as in: Settings > General > Reset, and then select “Erase All Content and Settings.” I hope you’ve got a backup. You’re going to need it.

Apple has admitted internally that iOS and its development plans are a mess. Its plan is to work on cleaning up its code — it’s called “quality assurance,” Apple — instead of introducing new features willy-nilly. I’ll believe it when I see it.

As an anonymous former iOS developer said on Reddit, project managers, not programmers, run the iOS show, and “everything became a priority number. P0 meant, emergency fix immediately, P4 meant nice to have.” The result? “Everything is always in crisis mode. … This is how you get bugs in shipping software. [Project managers] driven to schedule things and over manage engineers would decide on a whim that something was a P2. That was basically always shelved to a follow-up .1 release. Ultimately, engineers lost the freedom to decide when a feature was ready to ship. So here I see some ‘leak’ about quality and I think, this is just PR spin for a buggy iOS 11. Unless the company is willing to take power away from the all-mighty [project manager] org, I just don’t see how engineering will really change.”

Making matters even worse, he claims that Apple still uses a waterfall development model, which would make the company just awful at adapting to changing circumstances — for example, if its program has numerous bad bugs. Waterfall is also lousy at finding those bugs, because testing is delayed until it’s too late to make changes. In Apple’s case, it’s all too clear it doesn’t do anything like enough iOS testing.

To fix all of this requires a heck of a lot more than good intentions. I don’t believe Apple is anywhere close to making the fundamental management and development changes it must embrace to fix its software.

But let’s say that Apple is finally facing its internal problems; its external enemies aren’t sleeping. Besides the ones you know about, such as global smartphone leader Samsung, the Chinese smartphone OEMs, such as Xiaomi, Huawei and Oppo, are growing their sales at double-digit rates.

Apple lives and dies by the iPhone, with 69.74% of its revenue coming from iPhone sales in 2018’s first quarter. If its smartphone sales slacken, Apple’s in trouble. Spoiler alert: Smartphone sales are already shrinking in China , and they’re slowing down everywhere.

The problem isn’t just Apple’s to shoulder. I think we may have reached “maximum” phone. Some people still feel they must buy a new phone at least every two years. But for most people, that’s no longer sustainable. Phone makers can hype their latest models all they want, but the truth is that there’s really no compelling reason to keep buying one new phone after another for incremental improvements. Seriously, what can a new phone do for you that’s worth hundreds of dollars more than an 18-month-old iPhone 7?

Looking ahead, Apple in 2018 is thought to be betting on three new Apple iPhone models. It thinks people will keep upgrading forever. I think the company would be wiser to do a better job of cleaning up its software before customers finally realize that Apple’s luxury brand has become second rate.