The problem is that $user_id = bbp_get_topic_author_id( $topic_id = 0 )
is malformed. You need to remove the = 0
from $topic_id = 0
and make sure that the variable $topic_id
actually contains the ID of the topic you are trying to get the author of.