When should I not use WordPress? [closed]

This is a very broad question, that do not have one good answer. Each answer will depend on the type of site being build, relevant available hardware and software, available 3rd party libraries, end user familiarity with core UI/UX, ease of maintenance and/or contracting people to perform maintenance.

For example, if you are a microsoft shop kind of company and you need to be able to integrate with outlook, it will easier to do by using available .net libraries which are easier to use in C# and therefor you will be using windows OS and IIS and probably some kind of C# based CMS.

Or to answer the question in a more explicit way – for mainstream type of project there in no real difference in what you can do with all platform, the difference is always with which tools the developer has enough experience to be efficient using it.

When there are no external restriction on the tech you can use, all software are very similar and whatever can be do with one can also be done with another, so the decision to use X over Y has more to do with the skill set of the developer than anything else. I would not recommend for anyone to write anything that is JS based, but for people that were using node/react/whatever since the day they were born it will make much more sense to use it for project Z over starting to learn PHP and wordpress just for a one off project.