Take a look at the docs here:
You can only select children not grandchildren records. You can go the opposite way and query the grandchildren directly and get the parent information as part of the query. There is a similar question here that might help you structure your query. Found another similar question here too.
Understanding Relationship Query Limitations
When designing relationship queries, consider these limitations:
Relationship queries are not the same as SQL joins. You must have a
relationship between objects to create a join in SOQL.
No more than 35 child-to-parent relationships can be specified in a
query. A custom object allows up to 25 relationships, so you can
reference all the child-to-parent relationships for a custom object in
one query.
No more than 20 parent-to-child relationships can be specified in a
query.
In each specified relationship, no more than five levels can be
specified in a child-to-parent relationship. For example,
Contact.Account.Owner.FirstName (three levels).
In each specified relationship, only one level of parent-to-child
relationship can be specified in a query. For example, if the FROM
clause specifies Account, the SELECT clause can only specify the
Contact or other objects at that level. It could not specify a child
object of Contact.