The thing is by default, fabric-ca only has the following affiliations:
org1.department1 org1.department2 org2.department1
So, the fabric-ca being used in the sample does not know about the affiliation
The code which registers and enrolls users in the sample takes the org name and concatenates it with "department1":
let secret = await caClient.register({
enrollmentID: username,
affiliation: userOrg.toLowerCase() + '.department1'
}, adminUserObj);
So when you pass in Org3, it tries to register the user with the affiliation org3.department1 which does not exist.
You can look at the fabric-ca docs: http://hyperledger-fabric-ca.readthedocs.io/
The easiest way is to use the fabric-ca-client to do this:
fabric-ca-client affiliation add org3
fabric-ca-client affiliation add org3.department1