I'm jumping in having not re-read the OP properly and not even skimming through any of the replies.
One way this might (and its only might) work is if in the Spring of 1939 the Kriegsmarine can see that marching into Prague and the planned move against Poland has made war with Britain and France inevitable. Therefore they abandon plan Z instead of ordering 6 H class battleships and 3 O class battle cruisers between (IIRC) April and August 1939. Instead go all out for building U-boats. AFAIK all the material ordered was eventually used for U-boat construction anyway. However, this way you might speed the construction of U-boats up by 6 months.
One way this might (and its only might) work is if in the Spring of 1939 the Kriegsmarine can see that marching into Prague and the planned move against Poland has made war with Britain and France inevitable. Therefore they abandon plan Z instead of ordering 6 H class battleships and 3 O class battle cruisers between (IIRC) April and August 1939. Instead go all out for building U-boats. AFAIK all the material ordered was eventually used for U-boat construction anyway. However, this way you might speed the construction of U-boats up by 6 months.