SPI Flash - Unable to write to first 32 bytes in GD25Q128C
The writing works fine, but you seem to expect to get back what you write without erasing previous content. With Flash memory bits can only written to 0, not back to 1.
There must be some previous writes that have written bits to zero, so that is why reading back differs from data just written.
Flash chip blocks need to be erased to set bits back to 1, so they can then be written to 0.