Rim could have failed or you could have had an impact and damaged it.
Either way they have given you the benefit of doubt and sent out another rim.
There’s no benefit of the doubt needed. Roval warranty covers anything from lightning strikes to backing over the bike with your car for the first couple of years now.
The one time Specialized replaced a rim for me they did the work in house. Maybe they don’t have anyone that knows wheel building at present?
Had Specialized been made aware of the issue with the shop earlier I would have expected more from them than just sending a rim and disowning the situation. They could suggest a shop that can do the work in a timely manner, do it themselves, send out a replacement wheel or lend you one. But going to them with 4 days to go before a trip after months have gone by isn’t really feasible. Can’t see why there should be a differentiation between OEM and aftermarket wheels. As far as I can see in the specs they are the same rims. It’s not like a Kona coming with Mavic wheels. They’re all Specialized products, something failed and it’s their warranty process to get you rolling again. OP bought a whole bike with whole wheels, not a box of parts to be assembled.