I understand that forks are resolved by opting in for the eventual longest chain, preferring the chain with the longest POW. But everything I read on this suggests it's just random chance or that the next block is really "alone" on some nodes due to delays in propagating, so "tough luck".
But let's imagine the scenario where a miner changes the last block with incorrect information for his own benefit, creating block A which should be rejected by the network. Another miner creates block B with the correct data. We now have a fork, with block A and B being at the end of the chain. The next miner needs to choose one of the blocks, hopefully not validating the bad intentions of the first miner. How does this gets resolved, how does block A get proven wrong?