Yes, if you pass the 14 ATPL theory exams, take the CPL course and pass the flight test you will have a CPL. You would then have to do the IR within 36 months of the of the final ATPL subject pass, or you lose the exam credits.
So your scenario of doing the IR two years later would be fine, any more than three years later wouldn't be. If you went beyond those three years you wouldn't lose the CPL but you would need to redo the exams before taking a IR test.