The issue arises from a discrepancy in `username` checking between two components, one performing string validation and the other querying a MySQL database. This discrepancy allows for the registration of a new account with a duplicate `username`, as shown by using the `test%c2` string when a `test` account already exists.