Errors between published and unpublished

On several occasions I have programmed features or entire sections of a game, tested it, and it works fine, with no error lines, but then when publishing it to an executable, features that previously worked when within unity no longer function, are there any fundamental differences or changes that take place in the process that I need to know about? This has happened many times, and I often have to find a way around a problem for no foreseeable reason, and none of the publishing documentation seems to talk about this.

I can show examples if needs be, but I’m curious if there’re any general rules to take into account when publishing

This was actually down to the fact that in build, I was not seeing that I had errors, which - when they are hit - stopped the functionality of the function, and therefore had massively different outcomes from what was intended. Had I been running a debug build and been watching the log I would have probably noticed earlier.