I got a critical miss on 98% chance to hit, but that still does mean that theres a 2% chance to miss and that's what happened.

RNG is RNG. Unless it says 100%, don't expect not to fail.