Hi Karl, that is strange. Have you managed to get a code reader to see if there are any stored codes held in the "brain"? Incidentally, when you disconnect the battery, touch the negative cable to the positive terminal / cable which will discharge any residual capacitance in the system. I can't understand why the multiple disconnect and reconnect of the battery ultimately encourages it to start.
In terms of the not starting, even a modern car only needs 3 things to start, air, fuel and a spark. Assuming you have a decent spark as you indicate it runs okay once started, it might be time to look at the fuel supply. Additionally, air leaks on the inlet side can create a problem - try a smoke test to see if there are any leaks.
Good luck.
N6 JMX