This happens due to denial location permission of com.google.android.gms.
This can be fixed by grant the location permission using adb shell
adb shell pm grant com.google.android.gms android.permission.ACCESS_COARSE_LOCATION adb shell pm grant com.google.android.gms android.permission.ACCESS_FINE_LOCATION
PS. this sometimes happens on my devices (Tissot, Dipper, Vayu) with LineageOS 18.1 and OpenGapps