Is it possible that a single string produces two different hash results after going through the same SHA-256 hash function? The code I'm working on right now is doing this, and I assumed this should not be possible. Any help?
Is this possible using the same message? No. But the message / input for SHA-256 is defined as a bit string, which - for most implementations - means an octet string, also known as a byte array. Of course, in practice, this usually means that the function has one or more update methods that accept bytes, and a method that finalizes the input, so that the whole message doesn't need to be available at once. As for most modern cryptographic algorithms, the input is binary, not text.
However, what you are likely are talking about is a string of text. Now textual strings are strings of characters. To map characters to bytes the text needs to be encoded using a character-encoding. An example encoding is US-ASCII or the - largely compatible - UTF-8. However, there are also others, for instance .NET uses UTF-16 as default encoding (usually UTF-16LE, to be precise, mistakenly called
Unicode in .NET). Java uses different character encodings as default depending on the platform that you are on.
Besides character encoding, there may also be other tiny differences. In bash, it is often forgotten that
echo by default adds a newline, for instance. Windows, Linux and Apple all use different line endings. Unicode may have different representations for the same character w.r.t. diacritics, so you may need to normalize Unicode character strings. Unicode strings may also contain an (invisible) byte order mark at the start of the string. And of course there are the invisible special, non-printable characters that may be hiding in a string.
All those kind of tiny differences will create a different bit string, and different bit strings produce a hash where all the output bits are unrelated to each other. So if you want to find why a different hash is created, perform a binary compare of the input of the hash function. Or print out the input for the SHA-256 in hexadecimals or base 64 and look for it with your own eyes.