The payback period tells you when the money you invested comes back. To compare two projects you also need to look at the cash that arrives after that point.
An example with numbers
Two machines cost $12,000 and generate $4,000 net a year. Both pay back the outlay in three years. If one lasts four years and the other six, they bring in $4,000 and $12,000 respectively above the initial outlay, with no discounting or residual value.
Try it with your numbers
Compare both projects changing only how many years they last. Look at the payback period alongside the cumulative result.
Example figures for learning purposes. They are not a recommendation and do not replace professional advice.