Oddly the mapfile does not include a layer definition so it is not to clear how to reproduce the problem.
However, it is clear that scaling of end values is not very dependable. So a "SCALE=0,1" should not be trusted to treat 0 or 1 as being in the range. Where this is important, a small epsilon value should be added/subtracted to ensure end values are in range.