As others have stated, by using the hardware test, you can see that the accelerometer is stuck. To verify, enter "*#0*#" in your phone app to enter hardware test mode. Touch "Sensor". The X, Y and Z for the accelerometer must all change in rapid succession as you rotate your phone. If any are stuck on 32767 or -32768, you have a HARDWARE problem which cannot be fixed by updates of software/firmware of ANY kind.
I'm on my 3rd S6 edge. It appears that they work out of the box but if you do a fast charge (making the battery very hot), the accelerometer chip seems to break. It might be the placement of the chip in relation to the battery, or it's possible that the chip maker just had a bad batch. Not sure if Samsung is using Invensense chips or not but I'm sure this is going to be something more than a little problem for Samsung and the chip maker if the numbers grow. It's possible this is only on the edge, which would lower the problems for Samsung.