It seems that there is not problem with this kind of css selector because it is used in official addons too (addons website_slides > slides_tour.js):
{
trigger: 'iframe li.breadcrumb-item:nth-child(2)',
content: Markup(_t("Click on your <b>Course</b> to go back to the table of content.")),
position: 'top',
}
How about using div name=product_id to select the parent of your nth-child?
Is the problem maybe due to the fact that the modal content does not exist yet when performing your test ?