teamMetadataSchema.parse(team?.metadata) was called before checking if team exists, causing a Zod validation error on undefined instead of the intended NotFoundException. Also corrected the misleading error message from 'user not found' to 'team not found'. Co-authored-by: Pranav Gawande <[email protected]> Co-authored-by: Bandhan Majumder <[email protected]>