It seems like this happens when trying to fetch the location from a background isolate. After some debugging, I realized that the location package only works on the main isolate, and calling Location().getLocation() from a background isolate leads to this issue.
If you need background location updates, consider using the geolocator package.
Hope this helps others facing the same issue!