Service history is key. Most common.issues with diesels are dpf, egr or turbo failure.
If you do little mileage then I'd recommend you stick with petrol.
Changing the fob battery is your first port of call. Also if you have a spare key see if it does the same thing. If it doesn't then it could be a key issue.