There's no reason in principle this shouldn't work, and I just did some light testing, and I can see that connecting both variable and simple products to posts stores the correct associations in the relationship tables in the database.
You might want to check that yourself if you are comfortable using phpMyAdmin to inspect the database.
You should see the IDs of the posts and products that are being joined stored in wp_toolset_connected_elements, and then the associations between these elements are stored in wp_toolset_associations.
When I connect variable as well as simple products I can see these are correctly stored.
I don't know what context you are using the above code, but I suspect the issue is that $product->id is not the id of the parent product variation post but may be the id of one of the variations.
You should familiarise yourself with how WooCommerce stores product posts, specfically product variations. There is one master post stored in wp_posts (which is the post you are connecting with Toolset relationships), and each variation is stored as a separate entry in wp_posts (post type product_variation) linked to the master post as parent.
In your code $product->id is likely not the id of the master variation post (you should dump it to your debug log so that you can verify what id is being generated). WooCommerce presumably has some means of retrieving the parent ID if that's the case.