This post is to inform others:
Every now and then I get the "HRESULT E_FAIL has been returned from a call to a COM Component" error when setting DynamicMapEnabled to True.
I have been able to figure out that this error occurs when resizing the map window so that the height of the map component is 0 when enabling dynamic display. If the map window instead is minimized this error does not occur.