Tesla is currently in a deep hole in terms of debt, signifying that while model s and x are fantastic and super desirable, they're not making Tesla enough money to cover expenses, which makes them fail as a company. Yes, profit from sales of MS and MX went into M3 R&D, but Tesla's R&D will always be a huge money sink because innovation is their main selling point.
This is a bit of a roundabout argument. First, MX development costs are sunk, but profits haven't been realized yet. What we have right now is MS sales and profits which are funding R&D on MX, M3, Gigafactory, Supercharger network, and the revamped MS (!). I believe Tesla could remain a niche player - but that's not in keeping with their aspirations and mission statement.
MS and MX sales are enough to cover Tesla's overall expenses if they're not aiming to produce a lower margin vehicle. If anything, that is the bigger risk. A M3 failure or serious stumble is the thing that would sink Tesla.