My experience with these tier 3 VE pumps goes back a long way. In most of the cases I've dealt with the spitting, sputtering, smoking, run like crap condition is (or at least very often is) caused by just slightly incorrect pump timing. You put the rebuilt pump back on (or someone did?) in as close a proximity as possible to where it was before. Timing wise that is. Yes/no? Some external marks are visible in the photo and appear to be a close match. Often lock timed pumps don't have such marks.
Here's the point. For some reason I can't explain if the timing is off by just a few degrees it can cause the engine to run as yours does. I've seen it many times, not just on Mahindra engines but New Holland and Cummins engines as well. Maybe more. These pumps use a cold start advance. That's the gadget on the side of the pump with the electric shut off solenoid. Not the solenoid on top, the one one the side right out out front. When power (12 volts) is applied to the coil it opens an internal passage allowing transfer pressure to add a few degrees of advance to the pump's internal timing advance mechanism.
What I have found is if I loosen the mounting nuts and rotate the pump just the width of the mark and tighten it down that change in timing can make the difference. What happens is this. The cold start advance changes the timing when it's engaged. Mahindra uses a timer to control this. Start the engine and the advance is on. After twenty odd minutes the timer shuts off and so does the advance. When the pump timing is right on the edge of being right, the advance on or off will make the difference. That's where the twenty minutes thing comes into play. If it runs right with that on, and then runs ragged with it off you need to advance the pump a degree or two. If it runs right when the system is off, then you need to retard the pump by just a little.
You can experiment to prove or disprove the point. Take the wire off the solenoid. Use a jumper wire and apply battery voltage to the solenoid. You will hear and feel it click on and off. Now start and run the engine for a few minutes at about 3/4 throttle. Apply the 12 volts to the coil and see what happens in regard to how it runs. Is it better with the wire on or with it off? If it makes a noticeable difference then you have some decisions to make.