An E36 that cranks but won't start once it's hot, then fires again after it cools, is the textbook crankshaft position sensor failure.
As it heats up the failing sensor loses its signal, the DME gets no trigger, and you get spark and injection cutting out together while the starter still spins — let it cool and it comes right back. That heat-related, comes-and-goes pattern is the tell
…