WAIT: Query loop: Related products shows all products when there are none related

I’m assuming this is a bug or an oversight, but maybe it’s intended functionality. I have a “Related products” section on a product page and when there are no related products (either by category or tag) all products are shown. If there aren’t any related products, I don’t want to show any.

The related products query looks like this:

I wondered if this was a WooCommerce thing, but from looking at the code it appears that the default behaviour is to return an empty array of posts if there are no related products?

		// Don't bother if none are set, unless woocommerce_product_related_posts_force_display is set to true in which case all products are related.
		if ( empty( $cats_array ) && empty( $tags_array ) && ! apply_filters( 'woocommerce_product_related_posts_force_display', false, $product_id ) ) {
			$related_posts = array();
		} else {
			$data_store    = WC_Data_Store::load( 'product' );
			$related_posts = $data_store->get_related_products( $cats_array, $tags_array, $exclude_ids, $limit + 10, $product_id );
		}