Echoing home_url() returns current url in searchform.php

Just like @cjbj says, use home_url() without the slash.

home_url( $path, $scheme ); – $path (string) (optional) Path relative to the home URL.

instead of home_url() you can use bloginfo('url') to get the root/home of your wordpress site.