Hello,
I am building an app using sharepoint lists and connecting them through IDs. I am trying to filter a gallery with the ID of an item selected in the previous gallery and with a search box. The screen looks like this.

The code I have right now works fine since I still have not surpassed 2000 items in my list but it will soon be close to that number. This is the current code I'm using
Filter(
Entry_Details_1,
Employee_ID_100 = Gallery3.Selected.EMP_ID,
StartsWith(LookUp('SOP Header',SOP_ID = SOP_ID_2,'SOP Label'),TextInput6.Text)
)
The first select filter has no issues but the second condition is giving me a delegation problem. I'm not sure if it has to do with the fact that the title of the gallery is also a lookup. The code for the text of the title is this.
LookUp('SOP Header',SOP_ID = ThisItem.SOP_ID_2,'SOP Label')
I thought it was strange that I was getting a delegation error since according to this table both the StartsWith and Filter functions can process complex types without delegation.

I also thought it might have been because I was using multiple tests in one function but the same delegation error popped up when I was only testing that one filter condition.
Could anyone help me figure out what's going on, where the problem is coming from or how to solve it? I would appreciate any help.
Thanks!