Obviously and hopefully not the case, but I had a similar issue happen in a program I wrote, where a variable was being forced into a byte, being, 256 bits. Lol Everything was broken for so long and it took me forever to find a simple mistake of a var being cast to a byte.
Did find it interesting it being 256, or a bytes maximum, if you will.