Issues with incorrect S/S operation are commonly reported here.
Yours is just the right age for the battery to have worn sufficiently to cause the S/S function to misbehave; improperly sensing clutch &/or gear lever position sensors could be an issue also.
Sounds to me like the system isn't activating when it should, then picks up a spurious signal, activates, then immediately disconnects completely because the battery charge isn't adequate.
One easy test is to see what happens if you turn S/S off completely - I believe you can do this via the menu system in a 2017 car (on the early ones, you have to disable it every time you turn the engine on).
If S/S doesn't cut in when it should, try gently jiggling the gear level around the neutral position. This may cause it to sense neutral and engage S/S. If it disengages after less than about three minutes, chances are you need to replace the battery if you want to continue to use this functionality.