[situation],(subject) + 难免 + (会 / 要 / 有些) + [verb phrase]
[noun] + 是难免的 / 在所难免
难免 says something unwanted is likely, and understandable given the circumstances – a mistake, nerves, homesickness, an argument. It goes before the verb phrase, often with 会, 要 or 有些 after it, and the circumstances usually come in the clause before.
The unwanted thing can come first as the topic, followed by 是难免的 or the set phrase 在所难免 "is inevitable".
难免 comes with a sympathetic shrug, so it goes with problems, not good news. For a good outcome, use 一定 or 肯定.
难免 sometimes appears with a 不 that doesn't reverse it: 难免不出错 means the same as 难免出错. Recognise it when you read it, but write the form without 不.
免不了 is the spoken equivalent and goes in the same slot: 免不了会出错.