gh4mut what do you mean when is moved? are you mean when a usb cable it could be connected or do you mean an internal cable?
Potentially an internal cable.
gh4mut putting back the stock ROM could be annoying...
Agreed. But it may be that the shutdowns are annoying too! Obviously only you can decide how to balance those.
gh4mut I'm wondering if it could be an hardware test, maybe using shizuku (for higher priviledges).
I think Google, and probably Google's authorized service agents, have some test code. And I think there is a tiny bit included in Recovery. But I am unaware of a general Android hardware reliability test -- if you find one, probably people here would be interested in learning about it.