This is a software issue. There's no two ways about it.
EITHER the FMS should have settings for uncommon but not rare cases like "landing gear will not retract" OR the FMS manual needs to start with a big "WARNING: this will give incorrect results in the following cases! landing gear not retracted...."
If you take someone's bad arithmetic and put a program around it, people trust it a lot more. Mad Magazine was making jokes about this 50 years ago!
As someone who makes software, this personally pisses me off.