Instead of trying to find your way back to a puzzle you messed up, save before answering the question, and reload if you get it wrong.
It is much easier to reload a save than it is to find a building again. Personally, I don't think I could find a specific building I'd been to before if my life depended on it! There are save points outside of every building, so you can always easily save before trying a puzzle. You can also hop in and out of your ship quickly if it is nearby.
If you find that you are looking at a puzzle that you are unsure of the answer to, and you didn't save before starting it, back out of the puzzle by pressing circle instead of guessing. (I'm not sure what the key is for PC, but I'm sure it's whatever you use to exit out of other menus.) This will leave the puzzle unchanged, and you can go save and come back to it. This is also useful if you need to grab materials from your ship to select the correct option.
If you do answer a puzzle incorrectly without saving first, just let it go. Rewards are random, so you are just as likely to find the same reward at the next puzzle you come across. It's much easier to find a new building than it is to find your way back to a specific building that you messed up before. The game has more planets than you will ever have time to visit. Why waste time trying to find a specific building you failed when you can move on to something new much more easily?