The detect and disarm are two separate rolls. You can successful detect the trap and then fail to disarm, or you can fail to detect and successfully disarm. Failing to detect the trap does not alter your chance of disarming it.
Note that if you fail to detect the trap, it will tell you it is untrapped. If it tells you what the trap is, then it is guaranteed to be that trap (i.e. you cannot misidentify the trap). Also if you try and fail to detect the trap, attempting to detect it a second time will always fail.
The bottom line is that you should ALWAYS disarm, and never open the box. Also, if you are on the lower levels and your thief thinks it is an exploding box, then you need to seriously consider having your Priest use his spell.