To enter the key code you need to make sure all doors and bonnet are shut, all doors must be unlocked.
You may have to do this manually.
Then when you enter the key into the drivers door and do the 4 lock turns to tell the computer you are going to enter you keycode the dorrs will all lock. you can then start the sequence. If the dash is showing keycode lock out you will have to wait for that to clear first. Thiscould take 30mins to 1 hr before it clears, depends on how many times you have miss entered.
I went in circles with mine until I was told by LR that everything must be closed.