I believe the interest per month should be ((12th root of (1 + %)) - 1) if it matches how mortgage rates are calculated in my country, and if it meant to compound. If you can't find a suitable root function in your software, a power of 1/12 will also work. Everything else looks fine to me, but insurance also works differently for me (calculated separately but probably ends up the same).
There are full amortisation formulas you can implement also.