Well I tried to execute the stored procedure sp_MSins_dboTable (which was giving the error) with the same values in SSMS (with IDENTITY_INSERT ON) for the table and the values were inserted without any error. So this is very confusing, why the error is only happening when the stored procedure sp_MSins_dboTable is being run by replication agent? Can this be a permission issue?