Please look at the attached worksheet. function inv_sn(x,k) works fine in the main body, but fails is called from another function. inv_sn.sm(4 KiB) downloaded 35 time(s).
It should be noted that sn() seemingly depends on uni's EFI for Mathcad libraries; also, it's 32-bit only iirc. So, it OP wants others to see what he sees, he should mention the dependencies.