From the information provided, the best I could say is that your dynamic array formula using two FILTER functions could be quite resource hungry depending on the volume of data.

As adding data to a table will likely recalculate all of the formulas in the workbook and given that the workbook will have calculated before the VBA is run. Maybe switching off calculation within the VBA would improve performance, this way it would not calculate for each item that data is added to the table.
Sub test()
    Application.Calculation = xlCalculationManual
    
    '''Your code
    
    Application.Calculation = xlCalculationAutomatic
End Sub