Thank you all
Took the whole day to figure out the cause. We replaced a lot of parts since last month to get to the core of the problem.
It appears that wire harness was the culprit. Since the car is old, wire harness wasn't replaced with the new engine. Hence, there have been random wire breakages that were causing loss of power, shut downs when car operated with ac on, car shaking heavily etc. All were due to inadequate power.
Got the loose wires done. Will get a new harness to end this issue for once