Capacitor geolocation timeout after update to Ionic 7

I have been using @capacitor/geolocation succesfully in Ionic 6. But recently I updated to Ionic 7. Now I’m experiencing problems with Geolocation.GetCurrentPosition(). Half the time I get following error: ‘Could not obtain location in time. Try with a higher timeout.’. Can anyone tell me why this is happing?