It doesn’t matter if you assume that large scale conventional conflict between the us navy and the plan over Taiwan is impossible in a world with strategic nuclear weapons, otherwise it very much does matter, because navies are built on the timescale of decades and the plans you make today very much determine the future you will live in 10/20 years from now.
Well before any "battleships" are built, we'd need to build up the infrastructure to actually produce them. This would presumably still be useful when the battleships get cancelled and we move onto a real program.
Yes, the opportunity cost is the real problem with all of this. A navy takes approximately forever to build.
If we are extremely lucky the outcome of this will be increased shipyard capacity and refined shipbuilding practices just in time to switch back to building a multitude of actually-useful ships.
But most likely is that this ends up delaying the U.S.'s ability to build back its navy in time to matter, which is a tremendous issue given how we do our commerce and where some of our deepest friends are physically located.