Are you 100% certain that the avatar url you provided is something the Discourse container can talk to?
We have tests for this function: discourse/spec/models/discourse_single_sign_on_spec.rb at 76669bb5a6dfa8c3425c1988ae7f240f23fd28cf · discourse/discourse · GitHub