To me, it seems like there is a switch that is failing to trigger -- when the door handle closes, there is a switch that is supposed to confirm that the handle is fully closed. When this switch doesn't trigger, it tries again to present and then hide the door handle, to get to that confirmed "closed" state. Just my guess on what's happening. it really could be a number of things.
I'm a career software guy, who in retirement has become an expert in pinball repair. As such, I am quite familiar with software solutions to hardware defects. Pinball is REPLETE with this practice!
I don't know anything about the Lucid Gravity platform, how centralized it is or how much control they even have over the door handle logic (it could be an embedded system from a contractor for all i know), but it seems like a simple check -- if the car is in drive, and the door handle has failed to successfully close itself X number of times, then issue the close command one last time and send a fault message somewhere. It makes absolutely no sense to allow an infinite loop of two states calling each other back and forth forever. There's no valid use case for that. This strikes me as a product of immature and poorly thought out code. Yes, fundamentally, it's a hardware problem, but it's one that should be mitigatable through good software design.
If i'm right (and I could be wrong), then what we're really seeing is the result of two failures at once - a switch failure and a software failure to recognize the switch failure.
pinball machines are generally pretty good at recognizing a stuck or broken switch, and have code built in to discount that switch's input when making future decisions. Lucid should be able to at least get on that level.