Quoting from page 292 of A Dictionary of Basic Japanese Grammar (DBJG), entry for に, note 2:
"Any transitive verb used in the V-てあげる or V-てくれる construction can take に, if the verb does not take a human direct object."
"...ほめる, which takes a human object, cannot take に..."
The (only) example they give for the second quote is
先生は私(を / *に)ほめてくださいました。
My teacher praised me.
My issue is that since the indirect object (the one receiving the favour) and direct object (the one praised) are the same (私), one would normally leave out the indirect object anyway. i.e. you wouldn't say
☓先生は私に私をほめてくださいました。
But DBJG seem to be saying that a transitive verb in てあげる form with a human direct object cannot take an indirect object under any circumstances.
So let's construct a sentence where the indirect object and direct object are two different people (me and Tanaka respectively). Is the following sentence allowed?
先生は私に田中を叱ってくださいました。
The teacher scolded Tanaka (for my sake).