Hello All,
I have passed some invalid userid to the function isusernametaken and it returns true.
Discussion posts and replies are publicly visible
This is because you first try to cast that string into a variable of type UserOrGroup, and then feed that value into a function that expects a string.