I dont know if it will need reprogramming. Quite possibly.
But as for a second hand unit or getting your own one refurbished, I'd go for refurbishing. Either of your own unit (which might then be plug and play' ) or on an exchange unit basis.
A secondhand one may be older than the existing one, and at best would be 'working when removed' Who knows how long before that too has problems. All those labour costs and it may not last long.
Having your own repaired may cost a bit more, and a pita if the car is off the road for a week.
But hopefully it will go to a specialist who knows what they are doing. The better ones would replace all seals, gaskets and certain moving parts whether they need it or not. And if something is beyond repair may have suitable used parts to cannibalize into one good un . Others might just replace 'the part that always goes' , which to be fair might be all thats needed. And I wouldnt mind betting some of the units they receive for renovation are not faulty at all.
Refurbishers rely on a good reputation within the trade and may offer a guarantee on the part.
A used one may just come from a breakers yard, who have the labour of removing the unit from the donor car , and whos reputation may be general, and limited to replacing units that proved to be faulty. You might still face the extra labour costs.