Thanks for the personalised update. Hmmm, ok. I think I can see where your problem is with your automated process.
It's a guess as I'm not to able to test but I would suggest you try inserting a "BluetoothLE1.StopScanning" method once you have found your match and make sure it is used before the "call BluetoothLE1.Connect" method and see if that makes a difference.
I do not know specifically, it's always done that way in examples as best practice (including in my sample template files).
... it's possible that another device is found and added to the address list, which will then potentially change the address indexes as the list is auto-sorted.
It is better that the code performs logically and is not continually running a function when it is no longer required, the App scan could clash with the Arduino send for example.