Is there a Japanese word alternative to エラー that can be used in the context of IT? If not, what would be the closest?
間違い、誤り、過ち... would any of this work or what would be the most suitable in this case?
エラー is a very common word and I don't think you need to avoid it in IT contexts. That said, some errors can be safely translated using non-katakana words.
不正 (na-adjective) is commonly used in the sense of "invalid" or "illegal". Occasionally it's also used for unexpected run-time errors/malfunctions.
- HTTP 400 Bad Request は不正なリクエストが送信された場合のステータスコードです。
- ☆ 実行時に不正な動作が発生しました。
- ☆ サーバの不正が発生しましたが1時間後に復旧しました。
(☆ エラーが発生しました is much more common.)
Note that 不正 also means injustice, and 不正なプログラム almost always refers to malware today.
誤り has been historically used when we talk about I/O errors and error-correction mechanisms (eg 誤り検出訂正). It's also a generic word for mistakes made by human beings.
間違い is a casual word for human mistakes in general. In conversations 間違い is more common than 誤り.
不具合 refers to both sudden malfunctions and software flaws/bugs.
過ち usually refers to faux pas, misconduct, bad decision, etc.
On a site like Stack Overflow, you can use このプログラムには2個の｛エラー／誤り／間違い／バグ｝があります interchangeably. In formal error messages, I think エラー and 不正 are the only two words we commonly see.
(Edit: Incorporated Chocolate's comment on 不具合. This is another common word.)
The word I would use here would be 誤作動, as that is specific to machinery.