I am confused by the usage here. I have always used ”un paio di…” to mean “a couple of.” This seems like a very exact usage. Does “soltanto due…” really mean “a couple of” — or, rather “only two.”?
ReversoContext offers a mix of “couple of years” and “two years” for “due anni” in its search. Meanwhile it is only “couple of years” for “un paio di anni”.
This might also stem from the English usage. Depending on where you are, or your conversation partner(s), “a couple” is sometimes used to mean strictly only 2 - no more, no less. Some people can be very strict/pedantic about this, though most dictionaries do include “a small (indefinite) number” as an informal definition of “a couple”.
You can see some examples of this mentioned in this discussion too (with more links to similar discussions in the first comment too).