Quad falls out of the sky when switching from RTL to ALTHOLD or LOITER or STABILIZE.
I have seen a few members mentioned exactly or similar scenarios where the quad cuts the throttle during transition from RTL to another mode.
Is this a bug in the firmware or is the quad not set up correctly?
I have been flying fixed wings for many years but am very new to quads, and I lost my first DIY quad due to falling into a river and damaged my second quad due to the same issue.
My guess based on hundredths of other users in the forum, is that you missed too many steps to mention here.
It will take more time to me to list them and for you to read and understand my answer, then the time it would take you to read the Blog post that I already written.
I wrote that post explicitly for users like you.
Addressing the issues that users like you have.