my Yaris Hybrid 2021 did exactly the same sound. While accelerating with the combustion engine activated it would do that high pitch sound, but only sometimes.
I drove the car for 30 mins with the dealer seating in the car so he could hear it, but the car didn't make that sound. So the dealer told me to keep monitoring the sound and if it didn't go away to call him back.
Now it's 1,5 months later. The high pitched sound is gone, but it was substituted by a stronger sort of rattling sound also coming from the engine, I believe. The sound appears under the exact same situation: accelerating with combustion engine active.
I called the dealer again. The car is going back to the dealer and will stay there as long as it takes for them to listen to it and solve the problem.
If they aren't able to solve it or if they say it is normal, I will sell the car. The problems I've had with the Yaris Hybris 2021 make me miss my former Aygo that just drove without any issues for over 13 years.