I've tried to upgrade the rom in MOTO G4 Plus using TWRP version of 184.108.40.206 and during installation process I wiped out the existing android 7.0.1 without backup(understood the cost of backups now). As I faced error while installing android 9.0.1 with error 255 code because of TWRP some upgrade issue couldn't complete the installation process successfully.
I tried multiple ways to upgrade TWRP which was not successful and even fastboot commands aren't working now. Whenever I try fastboot + combinational command like devices and etc it goes into an infinite loop with an error code iterator not found. After a good amount of search found about ADB and happily can connect to my device using ADB now. Then started trying with multiple options like adb side load after reading multiple forum answers and posts I did pushed a rom to scared/data/media after reading this forum NEED HELP: Accidentally deleted OS in TWRP/Cant install Rom which was successfully pushed but didn't do any thing nor I couldn't understand what to do after pushing it.
Then started search again to install stock rom in any different ways before coming here and stumbled at this question which is similar did read the question and included forum post in it to go start the process when I did download stock rom stock rom download couldn't find any flashall.sh file to start the process
Now I'm stuck and couldn't find better place to find a working solution for this situation. Can somebody help me? What can I do while my phone is in this state?