Taiwan is a unique case.
Technically, the Chinese Civil War never ended. There was no signing of a peace treaty, and all the way through the 90s you had military standoff’s between Taiwan and the Mainland, i.e. the two militaries shot at each other. The relationship between the mainland and Taiwan is legally analogous to the one between North and South Korea.
The main reason mainland China can’t recognize Taiwan is because of the huge geopolitical and legal consequences. A pillar of US-China relations is the One China Policy. Recognizing Taiwan would throw that into flux.
If China recognized Taiwan as Taiwan, or as the Republic of China, there are tons of uncomfortable questions. Would Taiwan be admitted into the UN? Could Taiwan compete in sporting events under a Republic of China flag, or would you continue calling it Chinese Taipei.
There’s also Taiwanese domestic politics. Depending on the year, some Taiwanese parties still advocate for reconciliation, and perhaps eventual reunification with the mainland.
Add to the fact that China is currently led by a leader not afraid to pull the nationalism lever, and you have a host of reasons why recognition of Taiwan is a nonstarter.