Could be a low system charge, moisture in the system, a malfunctioning expansion valve, clogged evaporator fins or an overcharge condition causing the cold and hot air.
If the cabin air filter is clogged and things are freezing up moisture in the system, that might explain sometimes just blowing in the rear, but that's all just speculation.
Might want to start by having your a/c system checked that it's properly charged, take a look at the cabin air filter and replace if needed.
Need to diagnose things and eliminate possibilities one by one.
Answers
If the cabin air filter is clogged and things are freezing up moisture in the system, that might explain sometimes just blowing in the rear, but that's all just speculation.
Might want to start by having your a/c system checked that it's properly charged, take a look at the cabin air filter and replace if needed.
Need to diagnose things and eliminate possibilities one by one.