Inside I could not get GPS lock.
That is normal and some GPSs are better than others for this. I actually use this as a test for which GPS units I buy more of and which ones I stay away from. Even the ones that don't work indoors after an hour will still work well enough outdoors that I don't bother changing them out for the better ones even though I have a stock of about 5 new and unused GPS units.
I was able to get stable GPS of 7-9 sats, but note that PDOP shifted around from 3.2 to 4.5. Every time it went over 3.5 the GPS would go orange.
...
If I put my hand over GPS I can get it to go orange. But not red X
The default GPS settings say that GPS is green when it has >= 7 satellites and PDOP is <= 3.5
Stabilization will only go green when all sensors are green.
It will not arm until stabilization is green.
Once stabilization goes green, it will stay green even if sensors turn yellow (orange).
So if sats goes less than 7 or PDOP goes more than 3.5 the GPS turns orange.
It generally is still flyable if some sensors are orange.
How does the FC go to red X GPS? Loss of signal from data stream? High PDOP? It'd be useful to know exact conditions that FC uses to determine this.
The red X is supposed to mean that the GPS has a hardware failure, not just a loss of satellites.
The red X is supposed to mean that the GPS has a hardware failure, not just a loss of satellites.
I wrote that code. Before that, you could not really know what the X meant. Now it means that FC is not receiving any readable packets from the GPS.
If satellite count is low or PDOP is high, you still get satellite update packets coming from GPS. Depending on quality of GPS lock, you will have green square, orange square, or red square. Red X means something is broken because we are not getting any data.
After you get a red X, you could try unplugging the GPS and plugging it back in, instead of unplugging / replugging the flight battery.
So recreate the issue and leave the flight battery plugged in and try unplugging the GPS and plugging it back in. If it is a DJI GPS (or you have done the previously mentioned "save settings into the GPS" for a Ublox GPS) after that the GPS should reboot and start sending again. If it stays red X then something is wrong inside the FC? If it starts working, then the GPS gets glitches that are related to hard landings and that sounds like intermittent connectors or cracked PCB trace.