They are not the same situation, historically speaking.
Ukraine's situation needs to be understood in the context of the Cold War. It is similar to the crushing of Czechoslovakia in 1968. Given 2 major nuclear powers, both parties, NATO and the Warsaw Pact, had the mutual understanding not to be put their troops in direct hostile contact. That's what got the world through 50 years of much more significant threats than Putin's pointless victimization of a much smaller neighbor. Strategic ambiguity had a lot less value: red lines were drawn that signaled things not to do to avoid a nuclear escalation.
On the other hand, the phrasing and terms of US support for Taiwan was put in place when China was a very minor power, and was being courted by the US to counterbalance the USSR. China and NATO are still not in a Cold War. Arguably at some point in the future, the West and China may need to put in place behavioral protocols explicitly limiting the risk of a full on nuclear war between the 2. But in the meantime strategic ambiguity is not that harmful either - the diplomatic management of the whole Taiwan question is based on a whole lot of ambiguity - is it a country? does it have official representatives, etc... and it is not obvious what would be gained from changing that, aside from possibly provoking China, which to date has more or less behaved (with regards to Taiwan).
p.s. arguably Czechoslovakia was part of the Warsaw Pact, which Ukraine is not now, so it would have been more direct interference at the time. However, make no mistake most of the East European Warsaw Pact countries were entirely unwilling participants in the USSR's bid for global hegemony.