You’re probably hitting a WordPress bug in get_search_form()
If your theme has a searchform.php, you’re probably hitting Ticket #16541: get_search_form() ignores $echo if searchform.php exists.
Your workaround is fine if you’re just echoing the search form anyway, but if you need to capture the output in a variable, you can work around this with output buffering:
<?php ob_start();
get_search_form();
$my_search_form = ob_get_clean(); ?>