Sorry to hear about this. In all the time I have been on this forum, I don't recall this exact circumstance. The only thing closest was a software issue where the car would go into Neutral and stay there even when someone was driving. No one hurt. So when they take it to the shop, be sure to ask them to check if all the software updates were made including the safety recall one around 2016.
As to whether the warranty covers it, in the US, it would be if the original warranty was not expired. As yours is a 2017, fingers crossed.
Best of luck. Let us know what they find when they hook it up to the diagnostic computer.
If you are nearing the end of your original warranty, while it is in the shop, have them check everything.
Jeff in NYC
MB '21 GLC300; MB '06 E500W; MB '81 380SL
Retired: MB '17 B250e; MB '14 Be