Be sure you know who the owner and admin of the slack account is, it wasn't mentioned in your post.
Verify User D's Account Status: Confirm that User D has the same level of access as User A and User B in your organization. Sometimes, account types or roles can affect external collaboration capabilities.
Review User C's Invite Permissions: Ensure that User C has the necessary permissions in their organization to invite external members to the channel.