You can get time data by Epics using the Pivot Table function. You just need to do such steps:
Open the Time in Status for Jira Cloud app.
Select a Pivot Table view.
...
Then click the Fields button.
...
In the Fields menu, you can customize data presentation by setting your custom fields for Rows, Columns, Report Filters.
To get the Epic time in the issue field, drag and drop such fields:
Summary field → Rows,
Epic field→ Rows,
Key field → Rows,
Status field → Columns
Sum of Time field→ Values
...