How to change search page url so that it still returns a page when there’s no search query specified?

Isn’t that just because you’ve put ! empty( $_GET['s'] ) in your IF statement? Is your search page accessible when you remove that part?

EDIT:

Or maybe change your function to something like this (untested):

function wpb_change_search_url() {
    if ( is_search() ) {
        if ( isset( $_GET['s'] ) ) {
            wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) );
            exit();
        } else {
            wp_redirect( home_url( "/search/" ) );
            exit();
        }
    }   
}
add_action( 'template_redirect', 'wpb_change_search_url' );

error code: 523