I’ve actually done that several times over the years . Examples would be to get a non standard or wildcat chambering. Another reason is simply to replace a bad barrel.
Some of the cartridges I have rebarreled for over the years include 6mm/06, .338/06, 6.5x.284, .270x.308 improved, 6mm Mongoose and the .277 Wolverine. I also have a full custom built by Trapper Gun on an XP-100 action chambered in 6mm - .223 but I am not the original owner.