ホ is the 5th kana in the iroha order and the musical note E, while ニ is the 4th kana and the note D, so the two are easy to mix up as adjacent members of the same sequence.
Etymology
Derived from the second character of the iroha poem, used as an ordinal marker and later adopted for musical note naming.