Same on my D40 Series 4
Mine just started doing the same 2 days ago. Takes consistently about 20 minutes from turn on time to when both lights illuminate.
Took to dealer today. He said fault code indicated faulty brake light switch. He replaced. Picked car up from dealer - drove 20 minutes...