I expect John to x vs I expect John will x

Solution 1:

The way your question is posed shows that you're thinking about it wrong.
It's not the case that "some of these sentences take will and others take to".

First, it's the Verb (not the sentence) that "takes" a Complement, and every verb is different.

Second, expect can take both infinitive and tensed (that) complement clauses. Other verbs differ.

Third, the grammatical sentences with will above don't have that, but it's allowed --
these are correct, because expect, think, and know can all take tensed complement clauses:

  • I expect/think/know that [John will reply to your email]. (no. 1)
  • I expect/think/know that [he will reply to your email]. (no. 6)

so the complement clauses with will are tensed clauses, not infinitive clauses.
That means that the reason why you can't say no. 4 is that you must use he and not him in

  • He will reply to your email.

Fourth, on the other hand, the complements with to are infinitive clauses, not tensed clauses.
To is a marker of an infinitive; it's not a verb but a complementizer, and it doesn't mean anything.
And the subject of an infinitive must be objective -- him, not he -- so that's the reason no. 5 is bad.
The sentence below works because expect, tell, and want can all take infinitive complement clauses:

  • I expect/told/want [him to close the window].

This is a fact about the verb expect, by the way.
If you try the tensed (that) clause examples with tell or want instead, you'll get ungrammatical sentences, because tell and want can't take tensed clauses with that. And if you try the infinitive examples with think or know, the same thing will happen, because think and know can't take infinitive complements.

Grammar is not about words following words; grammar is about constituents, mostly clauses.
Get that right and the rest will follow.