first they were not going to relocate, any facilities in Leningrad were to be an addition not substitution.
second, we have the example that KM employed the Baltic Sea for their testing and training on new Elektroboote under much more dire conditions than ITTL.
An additional Shipyard and repair facility when Germany was already pressed for resources?
Let's assume that the capture of Leningrad gives a boost to the German offensive due to shorter front, better supply line due to Docks in/near Leningrad and the disruption of lend Lease though Murmansk. This will only increase the demand for oil and steel for the ground forces and put preasure on the supplies for the Kriegsmarine.
As for the second point testing in the Baltic is a small scale operation (one that OTL was only possible due to a massive minefield blocking much of the soviet Baltic Fleet movements) but if the KM moves its production and repair outside of allied bomber reach then the allies will make sure than anything afloat in the Baltic has a seriously hard time making its way into the North Sea and the most cost effective way is by expanding the already extensive minefields.
In the end large scale production and repair in the Baltic ports may simply not be worth it.