You never know quite what you are getting with a second-hand engine!
I would suggest that you start with a compression/cylinder leakage test, if you find that this is not up to spec., contact the supplier of the engine, if they won't play ball, quote the Sale of Goods Act to them - even a second-hand engine should be fit for purpose.
If the compression test proves to be acceptable, I would tend to clear any fault codes and see if they re-appear.
Are the spark plugs new?
Does it have a misfire?
Check the above and let us know what you find.
Regards.