I have had this before on an Astra. If you roll the car in a high gear
a few yards and then try it again, it seemed to work ok.
This was something to do with missing teeth off the starter gear, and
the starter motor has nothing to engage with.
Other than that it could be a faulty solenoid. This gives the starter
the nod to engage.
It could have a fault only when warm, a broken connection that expands
when heated up. Sometimes giving a knock with a hammer shakes it into
action, but the true fix is replacement.
Hope this helps, Jim