By default, the relationship field returns an array of post objects, so your $posts->post_name won’t return your desried post’s name. You’d have to dig into the array, or iterate through it. Or do something like set the relationship field to return an array of chosen post IDs instead, and pump THAT into your query using WP_Query’s ‘post__in’ parameter
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users