There are no errors logged since there are no errors. The script 'works', but it doesn't what you need it to do. The only thing we can conclude safely is that user 'levin' does not have the password that was provided after hashing it. It's probably best to continue your quest on the SMF forums, as there will be more people knowledgeable about how SMF works (I clearly have no idea).
Another thing you could consider, depending on your goal, is to add your code as a plugin. This way you won't have to check user credentials the hard way and can leave it up to SMF itself. It will then also not break after an update in which they've changed the hashing.