MKR GSM 1400 + MKR GPS Won't Update GPS

I have a MKR GSM 1400 and a MKR GPS connected as a shield. When I run the example sketch for MKR GPS it will connect to up to 6 satellites but not consistently.

When I try the following sketch (connect to Arduino Cloud via cellular and send latitude and longitude) it will connect to the cloud OK but it never updates GPS.

Is there any modifications I can make to the code to make it acquire GPS values?

#include <Arduino_MKRGPS.h>
#include <ArduinoIoTCloud.h>
#include <Arduino_ConnectionHandler.h>

const char THING_ID[]      = "";
const char GPRS_APN[]      = "";
const char PINNUMBER[]     = "";
const char GPRS_LOGIN[]    = "";
const char GPRS_PASSWORD[] = "";

float latitude;
float longitude;

GSMConnectionHandler ArduinoIoTPreferredConnection(PINNUMBER,GPRS_APN,GPRS_LOGIN, GPRS_PASSWORD); 
                                                   
void setup() {
  Serial.begin(9600);
  while(!Serial);
  
  if(!GPS.begin(GPS_MODE_SHIELD)){
    Serial.println("Failed to initialize GPS!");
    while(1);
  }else Serial.println("GPS Initilized OK!");
 
  initProperties();

  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  setDebugMessageLevel(4);
  ArduinoCloud.printDebugInfo();
}

void loop() {
  ArduinoCloud.update();
  
  if(GPS.available()){
    latitude = GPS.latitude();
    longitude = GPS.longitude();
    Serial.println("Latitude: " + String(latitude));
    Serial.println("Longitude: " + String(longitude));
  }
}

void initProperties(){
  ArduinoCloud.setThingId(THING_ID);
  ArduinoCloud.addProperty(latitude, READ, 10 * SECONDS, NULL);
  ArduinoCloud.addProperty(longitude, READ, 10 * SECONDS, NULL);
}

I'm adding below here the debug information which comes out on the serial monitor. It says it connects to the GPS network but then no data is ever made available; latitude and longitude never come.

GPS Initilized OK!
Arduino IoT Cloud Connection status: IDLE
***** Arduino IoT Cloud - configuration info *****
Device ID: 3a7968ba-f2e1-40ac-9f92-9a5fb89db85e
Thing ID: a7fc9b90-7ea3-47ff-8374-552186965635
MQTT Broker: mqtts-sa.iot.arduino.cc:8883
SIM card ok
GPRS.attachGPRS(): 4
Sending PING to outer space...
GPRS.ping(): 252
Connected to GPRS Network
Arduino IoT Cloud Connection status: CONNECTING
Arduino IoT Cloud connecting ...
Arduino IoT Cloud Connection status: CONNECTED

Because the GPS example worked by itself but not when combined with IoT cloud or connection handler libraries, I tried the same sketch with the TinyGPS++ library (using serial1 @ 9600) and it worked the very first time after having tried for 3 months. Because of that I think using the TinyGPS++ library is a valid workaround.

The following code booted up, connected to Arduino IoT cloud and sent GPS latitude and longitude float data across without issue.

Because of this I think there is some bug in the arduino MKR GPS library which I have added as an issue to the GIT here: Arduino IoT and MKR GPS library Compatibility · Issue #8 · arduino-libraries/Arduino_MKRGPS · GitHub

Here is the working code:

#include <TinyGPS++.h>
#include <ArduinoIoTCloud.h>
#include <Arduino_ConnectionHandler.h>

#define THING_ID ""
#define BOARD_ID ""

const char GPRS_APN[]      = "";
const char PINNUMBER[]     = "";
const char GPRS_LOGIN[]    = "";
const char GPRS_PASSWORD[] = "";

float lat;
float lon;

TinyGPSPlus gps;
GSMConnectionHandler ArduinoIoTPreferredConnection(PINNUMBER,GPRS_APN,GPRS_LOGIN, GPRS_PASSWORD); 
                                                   
void setup() {
  Serial.begin(9600);
  Serial1.begin(9600);
  while(!Serial);
  
  initProperties();

  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  setDebugMessageLevel(4);
  ArduinoCloud.printDebugInfo();
}

void loop() {
  ArduinoCloud.update();
  
  while (Serial1.available() > 0)
    if (gps.encode(Serial1.read()))
      if (gps.location.isValid()){
        lat = gps.location.lat();
        lon = gps.location.lng();
        
        Serial.print("Latitude: ");
        Serial.println(lat, 6);
        Serial.print("Longitude: ");
        Serial.println(lon, 6);
      }
  delay(60000);
}

void initProperties(){
  ArduinoCloud.setThingId(THING_ID);
  ArduinoCloud.addProperty(lat, READ, ON_CHANGE);
  ArduinoCloud.addProperty(lon, READ, ON_CHANGE);
}