Sounds like the battery is not 100%....this can give all sorts of error messages and weird things start happening. Charge it fully, reinstall and ensure the connections are really firm, then run through the setting of the windows and sun roof as described. Hopefully, you won't get the lockout code message popping up ("engine disabled enter eka code")and it will start. My indy always advises that when reinstalling a battery on a P38, one should leave it for around 30 min "to settle" after reinstallation as doing it too quickly can also throw up errors. Whether there's any truth in it or not, who knows - I've always done it and it works for me. Never had to use an EKA code yet, either, despite having to recharge / replace batteries over the years. When I know I won't be using the Rangie for a few weeks, I never lock it on the fob, just the door. That way it seems to not cause a problem when I take the battery out to charge it as I just unlock it on the key, not the fob.
Just my experiences over the years I've owned the Rangie.