From my experiences
CO code flight (booking class that earns miles) operated by AC (booking class that should not earn miles) = ROP credit
US code flight (booking class that earns miles) operated by UA (booking class that should not earn miles) = ROP credit
CO code flight (booking class that earns miles) operated by UA (booking class that should not earn miles) = NO ROP credit
US code flight (booking class that should not earns miles) operated by US = ROP credit
So I guess its quite random
And yes, its not fair that TG ROP wont get credit for UA's V/W/T/S fares while other Star FF get some credit