+0
1. I have finished my homework today. --present perfect
2. I had finished my homework yesterday. --past perfect
3. I had finished my homework by yesterday. --past perfect
4. I finished my homework yesterday. --simple past

I assume that the second sentence is incorrect, but if so, why? You cannot use an adverb or an adverbial phrase of past time in a past perfect sentence such as "yesterday," "two weeks ago," and "last year," but you can use them if you put "by," "till/until," or "before" in front of them (e.g. "by yesterday," "until last week")?
+1
ExpYou cannot use an adverb or an adverbial phrase of past time in a past perfect sentence such as "yesterday," "two weeks ago," and "last year,"
Wrong! That rule applies to the present perfect, not to the past perfect.

Sentences 1 and 2 are a little awkward as isolated sentences, but they might be OK in the right contexts. Sentences 3 and 4 are OK, though like 2, 3 has an isolated past perfect, which is hard to interpret without more context.

CJ
Comments  
Teachers: We supply a list of EFL job vacancies

I am unable to get over your endorsement of the association of the time adverb with the past perfect tense . As far as my knowledge of the language or memory goes some prepositions like before , until , by should precede the time adverb ' yesterday ' to facilitate the combination of the past perfect tense with it .

I hope you will reconsider it .

I'm not sure what, specifically, you are objecting to.

I found the following online. Maybe they will help you to understand my answer above.

I thought you had finished yesterday.
Mother asked him how much they had finished yesterday.
Today I sent the Amharic Spelling Book to the King, which I had finished yesterday.

CJ