A friend of mine, who really should join up for here suggested that the body dissapearing thing should be to be an act of will.
Ben when he is cut down by Vader knows he is going to die and he knows the correct meditiation to maintain his consciousness and return to the physical world via the Force. The same is true of Yoda.
Qui-Gon and Anakin don't know the correct procedure but learn it in the afterlife because there is a need to return.
Qui-Gon needs to help the last two Jedi fix the situation caused by the rise of the Sith and Vader needs to continue his redemption by helping the last Jedi rebuild what he destroyed.
That's a good explanation but I don't know how that could be put on screen in a way that doesn't sound (if you pardon the pun) forced.