Hi there, I had a little trouble using repair to template also.
It is a known bug that the repair bay sometimes/always fails in automatic mode.
The problem I had was after an automatic repair the bay would stop and begin the whole process again. and just repeat over and over without actually fixing the vessel, I had to set to manual to get the job done.
I also found that if my ship was damaged and i manually add some blocks for whatever reason before going to repair, those blocks would not be replaced with the original painted ones, so it screws the template a bit.
summary
be sure template is saved first
donāt add blocks to a damaged vessel, or at least remove those blocks before repair.
Always use manual mode.
repair bays do not work very well amidst structures, they work a lot better on the roof with nothing of the nearby structure being higher than the bay itself. (this is my approach for cv repairs)
If there is any other specific issue I am not aware of please let me know.
I did try all of that and more. It just refuses to repair to the template. This is on a space base and itās on the same level as the structure, though well away. The repair area is a good 40 blocks away from anything. I think the last thing to try is to raise it up on a tower well above any of the structures.
SOLVED (At least in my case anyway!)
Ideally ship must not be on the same level as space structures. Ship must be level and touching the repair block. The āat least 3 blocks above the bayā rule I saw from the past doesnāt seem to work.