My E39 stored previous faults in the ignition key which the dealer was able to see. If its an intermitted fault usually it clears after several succesful starts
The faults will usually remain for 40 clear drive cycles, so that means it needs 40 trips where the fault doesn't occur before it will wipe itself from the main error code memory. It will remain in the shadow memory, but the BMW dealer tools ignore this.