You can try running this script once; it might help you. Here you go: A script to create dummy users for your Discourse forum.
Additionally, your script seems to work quite well, but the issue lies with the data you’re using in your CSV file.
I tested your code using the following sample data:
Username,Name,Email,Password,Bio,Location,Confirmed,Active,Join Date
Paul,Paul Paul,paul@example.com,tough001!@,This is Paul,Australia,TRUE,TRUE,2023-12-30T14:00:00Z
radhika01,Radhika Singh,singhradhika@example.com,tough001!@,This is Radhika Tomar,India,TRUE,TRUE,2023-12-30T14:00:00Z
It worked perfectly fine for me. A few things to keep in mind: use passwords that are at least 12 characters long and ensure they are strong.
Give it a shot and let me know if that works for you :))