The approach I’ve used is to include in the result only the first row of the tests table for each [Type] found in the rows identified by [Related tests].
The SELECT() expression looks through each row in [Related tests]. For each row, the FILTER() expression is performed to list the rows in tests that have the same [Type] value and that occur in the [Related tests] list and that have a lower row number. If there are no such rows (the result of FILTER() is an empty list, or “is blank”), we know that the row we’re examining is the one with the lowest row number for that [Type] value.