I possess a 2007 W639 and have experienced an intermittent issue with starting when the engine is heated. It merely emitted a click, like to a depleted battery. However, if you kept the hood raised and attempted to start the engine every few minutes, it would gradually begin to turn over with the key, initially very slowly and for only a few revolutions, then increasingly faster and longer until it eventually began. The cold start was consistently satisfactory.
The battery passed the test, however it was aged (the original from 2007); the earth strap and connections were satisfactory. The battery is located beneath the passenger seat, hence it was not subjected to heat soak from the engine impacting its performance. The initial concern was a 'lazy starter motor,' a common issue with certain brands, particularly BMW. However, I opted to replace the battery because (a) it was aged and (b) this solution was significantly more economical than purchasing a new beginning motor, which ultimately resolved the problem.dk: It has been satisfactory ever since.