The spell description doesn't say you can't
Preface: You cannot true polymorph a Goblin into a Doppelganger.
From the spell description. (Goblin is a CR 1/4 creature).
If you turn a creature into another kind of creature, the new form can
be any kind you choose whose challenge rating is equal to or less than
the target's (or its level, if the target doesn't have a challenge
rating).
Discussion
If you chose a CR 3 creature like a Killer Whale, the spell's language indicates that it is the new creature: a Doppelganger. (Likely one with a taste for raw herring). Why? Nothing in the spell description says that you can't.
- Rulings versus Rules: A DM might rule that due to the nature of the Doppelganger that the prohibition works both ways. I'd find that a reasonable ruling, but the specifics of the spell don't prohibit the change into a Doppelganger.
The Fine Print
There's some fine print to consider (at least in the SRD version of True Polymorph, p. 188).
If you concentrate on this spell for the full duration, the transformation lasts until it is dispelled.
The "full duration" refers to the hour of concentration it takes to make the true polymorph permanent. That true polymorph is "until dispelled" is shown in the SRD and in editions of the PHB after the first one was issued.
The Doppelganger can use its action to polymorph into a Small or Medium humanoid it has seen, or back into its true form.
Its true form is now a Doppelganger, not a Killer Whale. It can't change back into its old form to go hang out with its orca friends (It could have done that had it originally been a CR 3 humanoid, for example a Hobgoblin Captain). Might the Doppelganger want to return to being a Killer Whale?
The target’s game statistics, including mental ability scores, are
replaced by the statistics of the new form. It retains its alignment
and personality.
If someone knows that the Doppelganger was originally a Killer Whale and wants to return it to that form, or if the now-Doppelganger encounters an effect that dispels magic, then this subsequent dispelling returns it to Killer Whale form by either a friendly or hostile action.
This raises the in-game question of "Why would he want to be a Killer Whale again?" (Beyond the obvious case of his agent wanting him to star in Free Willy 5: the money's too good!) That's up to the DM to decide based on the story and motivations of the NPC's and monsters under his control. Something about the smell of fresh herring, down by the docks at midnight, awakens a yearning deep in the Doppelgangers heart ...
In that case, convincing someone to cast another true polymorph would be wasted effort, and would not make the change per the rule you cited. A dispel magic spell could if the DC check is successful, and a dispel magic spell would if it is cast from a 9th level spell slot.
Dispel Magic(p. 136)
Choose one creature, object, or magical effect within range. Any spell
of 3rd level or lower on the target ends. For each spell of 4th level
or higher on the target, make an ability check using your spellcasting
ability. The DC equals 10 + the spell’s level. On a successful check,
the spell ends. At Higher Levels. When you cast this spell using a
spell slot of 4th level or higher, you automatically end the effects
of a spell on the target if the spell’s level is equal to or less than
the level of the spell slot you used.
There's another way that the Doppelganger would revert (at least for a while) to its original Killer Whale form: it encounters an antimagic field.
Any active spell or other magical effect on a creature or an
object in the sphere is suppressed while the creature or object is in
it. (SRD p. 117)
Antimagic field lasts for up to an hour. Will the Killer Whale survive for an hour if the antimagic field is not encountered in the water? That depends on the situation, and might be the core plot hook for Free Willy 6!
You couldn't change into a lich because a lich isn't humanoid or a beast
The change shape feature of the Brass dragon says (emphasis mine):
The dragon magically polymorphs into a humanoid or beast that has a challenge rating no higher than its own.
A lich is an undead, not a humanoid or beast. So a brass dragon cannot change shape into a lich. For a similar reason, you can't change into a Glabrezu, since a Glabrezu is a fiend, not a humanoid or beast.
If there was a different creature, yes, this could work for Innate Spellcasting Only
In the Dungeon Master's Basic Rules provided by WoTC, the spellcasting trait is defined as follows (emphasis mine):
A monster with the Spellcasting class feature has a
spellcaster level and spell slots, which it uses to cast its
spells of 1st level and higher (as explained in the player’s
D&D basic rules and the Player’s Handbook).
So, based on the language used, it's clear that non-innate spellcasting is distinctly a class feature which is grafted onto other creatures. As such, changing shape into the form of a humanoid with this feature will not provide you with their spellcasting ability.
However, Innate Spellcasting states (again, emphasis mine):
A monster with the innate ability to cast spells has the Innate Spellcasting special trait
This confirms that innate spellcasting is not a class feature, but a different kind of special trait. And since this trait is also not a legendary action, the dragon will gain the innate spellcasting of a creature it changes into.
So, if you can find a humanoid or beast to change shape into that can cast dispel magic using Innate Spellcasting, then you should be able to change shape and then cast it on yourself, which could dispel the True Polymorph. Just keep in mind that the dispel magic will require an ability check to dispel the polymorph unless it is cast at 9th level.
Best Answer
Yes you can true polymorph into an ancient brass dragon
As you say, the spell and rules are clear. An ancient brass dragon is a creature, it is not a shapechanger (and may not matter if they were), and it is of the appropriate CR for your level.
Thus, there is no reason why you would not be able to use true polymorph in this way.
Ancient Brass Dragons are not shapechangers
Ancient Brass Dragons are not considered shapechangers. A creature is a shapechanger if they have the monster subtype (Shapechanger). Ancient Brass Dragon's creature type is dragon.
The fact that it is able to change shape (a special ability) is irrelevant to being able to transform into that shape. The dragon does not have the shapechanger subtype, thus it won't be potentially conflicted with the shapechanger subtype restriction.
You can use all the abilities of your True Polymorph form
Jeremy Crawford says:
According to that same section "Special Traits, Actions, and Reactions" are part of a monster's stat block.
Ability to change shape back to your old form is unclear.
It is worth noting that you may not be able to use change shape to change back into your old form: Can you use a Dragon's Change Shape Ability to Turn Back Into Yourself?