Why is it called the dependency inversion principle

When should the dependency inversion principle NOT be used?

It seems to me that the original question lacks part of the DIP point.

The reason I am skeptical is that we pay a certain price for following this principle. Suppose I need to implement Feature Z. After analyzing it, I come to the conclusion that Feature Z is made up of functions A, B, and C. I create a Fascade class Z that uses classes A, B and C via interfaces and at some point I realize that task Z actually consists of functions A, B and D. Now I need to scrap the C interface, the prototype of the C class, and write a separate D interface and class. Without interfaces, only the Wave class would have to be replaced.

To really take advantage of the DIP, you must first create class Z and invoke the functionality of classes A, B, and C (which are not yet developed). This is how you get the API for classes A, B and C. Then you create classes A, B and C and fill in the details. You should effectively create the abstractions you need when building Class Z based on the needs of Class Z. You can even write tests around Class Z before Class A, B, or C are even written.

Remember, the DIP states that "high-level modules should not depend on low-level modules. Both should depend on abstractions."

Once you've figured out which Class Z needs and how it would like to get what it needs, you can enter the details. Sure, sometimes changes need to be made to Class Z, but 99% of the time it doesn't.

There will never be a class D because you figured out that Z needed A, B, and C before they were written. A change in requirements is a whole different story.