Now switching to B means paying those capital costs. However, equipment has a finite lifespan so if you time the transition to the point when you need to replace A anyway it’s essentially free.
At the consumer level electric cars are a reasonable approximation of this. For many people, TCO is about the same, but switching early is a poor choice. Similarly, for electric companies wind and solar are unlikely to outcompete existing coal power plants, but it can cheaply replace yet to be constructed coal power plants.