The problem seemed to be the class name.
This code works now:
function create_custom_product_type() {
class WC_Product_Books_Product extends WC_Product {
public function __construct( $product ) {
$this->product_type = 'books_product';
parent::__construct( $product );
}
}
}
add_action( 'init', 'create_custom_product_type' );