When using Apex Class as a Data Provider for Tasks on a Case Timeline, I am not seeing the "User had a task with User" and "User had a task" subtitle appear correctly. It is missing both user references:

When I create a Task child object configuration of Data Provider type Related Record, these values display as expected:

I cannot see anything in the configuration or Apex that would relate to what is displayed in this section. We are also querying and returning the WhoId and OwnerId in the Apex too.
Please note that we need to use the Apex Class Data Provider as we need multiple references to the Task object with specific configuration.
Is there anything obvious that I may be missing for this to display correctly when using Apex Class Data Provider?