Sales of Tesla's  (TSLA)  more expensive Model S and X vehicles have weakened recently, and one analyst argues the reason could be that the electric vehicle maker is losing out to competitors, especially in Europe.  

Alliance Bernstein Toni Sacconaghi wrote in a note out Tuesday evening that sales of the luxury sedan Model S and luxury crossover Model X models have fallen considerably in the past two quarters, from a quarterly rate of between 20,000 and 25,000 vehicles to just 14,000. And the average price of those cars has fallen 10% year-over-year in the second quarter, contributing to a decline in Tesla's gross margins from 27% to 18%. These sales declines "have been a huge drag on Tesla's recent financials," Sacconaghi wrote. 

Tesla shares were down 2.34% to $220.63 Wednesday morning. The company is also facing a lawsuit from Walmart  (WMT) for solar panels installed by Tesla on the roofs of several of its stores allegedly catching fire. 

Like other analysts, Sacconaghi thinks competition generally expands the total market for electric vehicles, which can serve as a positive for Tesla. But that has not been the case in recent months, according to Sacconaghi  Much of the competitive pressure Tesla currently faces is coming "particularly in Europe, from Jaguar and Audi," Sacconaghi noted. Jaguar's iPace and Audi's E-tron could be to blame, he thinks. And high-end electric vehicles are also expected soon from Mercedes and Porsche. 

Sacconaghi also mentioned it's possible that Tesla's all-important Model 3, which accounts for roughly 50% of Tesla's revenue, is cannibalizing sales of the X and S models. He noted that out of all potential theories supporting the S and X sales declines, "of course, competition would be the most concerning of these hypotheses." 

Alliance isn't changing its estimates on Tesla at the moment and has a $325 price target, representing 46% upside to the current level. Tesla's stock has fallen 28% year-to-date.

Save 57% With Our Labor Day Sale. Join Jim Cramer's Action Alerts PLUS investment club to become a smarter investor! Click here to sign up!