After reading the spell descriptions carefully, I think the two spells are diametrically opposed. Animal Shapes states:
The transformation lasts for the Duration for each target, or until
the target drops to 0 hit points or dies.
So, say you change a creature from shape Y into shape X. The transformation, shape X, will last until one of these conditions is met: The caster uses an action to choose a new form, the caster stops concentrating, 24 hours go by, the target drops to 0 hit points, or the target dies.
True Polymorph transforms the target into something else. Lets call it shape Z. This is a different transformation. That is a direct contradiction with what Animal Shapes' spell description states.
The effects of different spells add together while the duration of those spells overlap.
(See: Combined magical effects)
The two spell's effects are added together, but not compatible.
Thus, the two spells are in conflict.
I think this is an accurate reading of the spell descriptions. I also think this makes sense thematically. If one spell is focused on maintaining shape X, it would be in conflict with a spell focused on maintaining shape Z.
So where does that leave us? I think the higher level spell wins (or you trigger a conflict on a tie), but I only have instinct and flimsy evidence to back that assertion up.
So that leaves us with three possibilities to solve the conflict:
True Polymorph wins the contest and cancels Animal Shapes on the
target.
1A. True Polymorph uses the Animal Shapes form's CR for its restriction on the new form. That means that form Z can have a CR of up to form X's CR.
1B. True Polymorph uses the target's original CR. That means that form Z can have a CR of up to form Y's CR.
Animal Shapes wins the contest (for some reason) and True Polymorph
is canceled. This means that shape X is maintained as described in
Animal Shapes and True Polymorph has no effect.
- The two spells conflict and nullify each other. That means the
target reverts to shape Y and both spells end.
Any of these options would solve the paradox, but I don't see options 2 or 3 as being very likely. So, option 1. I believe, that rules as written, 1A is more technically correct. Until True Polymorph's transform is applied, the creature has shape X and thus shape X is used for True Polymorph's restrictions.
That said, as a DM, I would enforce 1B. I believe that permanently increasing a creature's CR using True Polymorph is not something that should be possible.