I went nuts with that issue for a few months early this year. Chasing an intermittent issue is miserable and I was swapping cables and AMS hub. What finally solved it was replacing the small AMS interface board just inside the back cover of my X1C.
I had the same problem twice.
Bambu Studio shows that AMS is not connected.
All 4 LEDs red.
The print head moved in the air above the part.
I had to stop printing.
There was a loose contact at the bottom connection of the filament buffer.
After wiggling the bottom connector once, the AMS was back on.
However, all the pins in the connector were in the right place.
L.G.
Frank
I confirm. Had the same problem. After I adjusted the bottom connector on the hub, this problem went away. Now I always check this connector before printing.