Check the CAS tags to see if they are tagged as uniform parts. You need to go into Studio's Warehouse view to do this one. Click on a CAS Part and find the Tags entry on the right. Click the Edit Items... button and see if there are any uniform tags in there. Remove them if there are and save.
You may also want to see if they are tagged for "situation" and disable that as well. It seems disabling random for CAS parts only stops Sims from wearing them as their actual clothing choices but not for situations such as festivals or parties, etc.
These changes have to made manually I'm afraid. There is no batch fix for this.
Make sure you backup your files before you make changes, just in case.