Since I also have a Toyota Yaris, I know this car ultimately. On the condenser (radiator of cooling air conditioning system), dirt accumulates, which worsens the heat dissipation and efficiency of the whole system, which increases the load on the compressor. As a result, the climate control starts to automatically shut down because the system overheats, and the pressure rises above normal. Besides, the metal begins to rust under a layer of dirt - even aluminum is exposed to acid corrosion. Suppose while driving in congestions, the conditioner suddenly stops working in a car, but after some time, it manages to start when moving at speed. In that case, it is necessary to clean the condenser urgently.
Reliable professionals can do this.