Rather than using the
add_action( 'wp_head', 'wp_no_robots', 1 );
Try using
add_filter( 'wp_robots', 'wp_robots_no_robots' );
In your code you are actually trying to add one more function call to pre called function rather than just changing its value to noindex. Use add_filter instead. 🙂