I work in animation. There are two reasons this is okay. One, the company owns the rights to the character lightning McQueen and they own the performance of the character by way of their contract with the actor. This probably makes more sense when the specific voice performance is sounds more “charactery” and less like the actors speaking voice but the same principle applies.
Additionally there is usually a provision explicitly allowing for this in the contract with the initial voice actor. Depending on the voice actor’s leverage, they can negotiate for things like approval over the replacement, right of first refusal to voice the character or payment when a sound-a-like is used.
The fact the character sounds exactly like Owen Wilson himself is somewhat incidental though understandably makes this confusing. What they couldn’t do in this case is have an Owen Wilson soundalike voice a DIFFERENT Disney character. They only own Owen Wilson’s voice as it pertains to portraying the character Lightning McQueen.
In the OpenAI situation and Frito Lay there is no initial contract granting any rights to a voice performance.