Stuck at boot animation on multiple custom ROMs
After much try and waiting I couldn't get any satisfactory result out of it. So ultimately I had to flash the stock firmware. The name of the firmware could be deduced from the command fastboot getvar all

https://androidforums.com/threads/bootloader-unlock-back-to-stock-for-motorola-e4-plus-owens.1264881/

This is the link anyone who's facing the same issues can refer to.