get_avatar() as backround image

It’s hard to say exactly what the problem is with your code, but…

There is at least one major flaw – you don’t pass any param to get_avatar_url, but first param for that function is required and should contain ID or email. To be precise:

$id_or_email (mixed) (Required) The Gravatar to retrieve a URL for.
Accepts a user_id, gravatar md5 hash, user email, WP_User object,
WP_Post object, or WP_Comment object.