I have spent a considerable amount of money trying to resolve the issue even though it is mostly just an inconvenience (I have never had the top get stuck open or closed).
Things I have done. Complete replacement of the top hydraulic harness (2021). Refurbishment of the hydraulic pump (2019). Replacement of salmon relays every 2 years.
Our Zpost top expert RobbiZ4 thinks replacing the coupling lock microswitches is the next thing to try, which seems pretty inexpensive (less than $100 for the microswitches). Just need the time and space to do it.
I have instructions both from BMW and RobbiZ4 (that I would share with his permission.
Alberts Pay Less Heating Oil