If I understand the rule your brother is imagining, it's incorrect. The rule for pronouns in the English language is that the listener/reader must use common sense to figure out what the pronouns refers to and the speaker/writer must ensure it's unambiguous. Most of the time, we do this so easily, we don't even notice.
There is no grammatical rule to mechanically tell you what noun a pronoun refers to. There is no way to use a pronoun to refer to a noun in way that is wrong grammatically.
For example:
When Mary saw the beautiful blue bicycle in the store window, she knew she had to have it.
There is no question the "it" is the bicycle, not the window. Why? Because we know that people want bicycles, not windows.
There was a beautiful blue bicycle proudly displayed in the store window. When Mary looked through the window, she knew she had to have it.
Again, "it" must be the bicycle. Not the window.
It's not the grammar that tells you this, it's the logic and common sense. Grammar is always ambiguous about what noun a pronoun refers to.
The supervisors told the workers that they would receive a bonus.
Who would receive the bonus -- the supervisors or the workers? You can't tell and grammar doesn't help you. But if the previous sentences talk about a bonus and make it clear would would receive it, then this is fine.
You can even do this:
Although Jack was quite wealthy, he didn't put any of it to good use.
Any of what? Clearly it must mean his wealth, even though there's no mentioned noun for it to refer to.
Grammar doesn't provide the rules for this, logic does. It can only be wrong if it's confusing or ambiguous.
However, SF. pointed out a problem with the example sentence. When we hear the word "Eric", we haven't yet heard the words "psychology class", so we can't tell correctly what the "it" refers to.
Because "Eric" is in the place the referent would usually go, we try to make "Eric" be the "it", which fails because Eric is something we would not expect to be compared to classes Eric has taken. This causes confusion in the listener/reader that can only be resolved at the end of the sentence.
This type of confusing construction, while grammatically and logically valid, should be avoided.
it
refers to the subject of the sentence. In this case, it would refer to Eric, which is definitely not what the author intended, and the reader must make a double-take, re-parse and match upit
withclass
.