if/else question

Yes it is working exactly as you wrote it.
If it is high then the first if gets true and the second is false so the else kicks in.
Therefore you get both high and error.