Peace be upon you and God's mercy and blessings.
Ayatollah Khamenei (may God protect him):
It is necessary to wash the right side before the left side in the ritual purification, and this is obligatory as a precaution. Therefore, washing in the mentioned manner is invalid as a precaution. However, you may refer to another jurist in this matter, taking into account the most knowledgeable among them as a precaution. For example, if you refer to Ayatollah Sistani (may God protect him), you can correct all previous actions.
Ayatollah Sistani (may God protect him):
It is obligatory as a precaution in Ghusl al-Janabah to wash the entire head and neck first, then the rest of the body. It is recommended as a precaution to wash the entire right side first, then the entire left side.
May you be successful in all good.