Function to change post status IF current user and post author are the same

I was unable to find any action called wp_update_post. Are you sure it’s a valid one? Lets try the hook publish_post.

add_action('publish_post', 'check_user_publish', 10, 2);

function check_user_publish ($post_id, $post) {

    $user_id = get_current_user_id();

    if ($user_id != $post->post_author)
        return;

    $query = array(
        'ID' => $post_id,
        'post_status' => 'draft',
    );
    wp_update_post( $query, true );

}}

code not tested