Great short answer from @Spectral Instance but there is a long answer to the question of whether this can be made any faster as well.
The idea is to sort the data once then use binary search.
Formula:
=LET(colA,A1:A100000,
colB,B1:B100000,
keys,colB&TEXT(ROW(colB),"000000"),
keys1,colB&TEXT(ROW(colB)+1,"000000"),
sortkeys,SORT(keys),
sortA,SORTBY(colA,keys),
XLOOKUP(keys1,sortkeys,sortA,,1,2))
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/eRfJK.png)
where column C contains the result of the original index/match for comparison. Ideally there should always be a match for each agent (an even number of entries) but if this is not the case the speeded-up formula shows spurious matches towards the end of the data (because if there are no more entries for 'L' for example, it tries with the next alphabetical entry, 'M').
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/VCa5L.png)
You could adjust for this with
=LET(colA,A1:A100000,
colB,B1:B100000,
keys,colB&TEXT(ROW(colB),"000000"),
keys1,colB&TEXT(ROW(colB)+1,"000000"),
sortkeys,SORT(keys),
sortA,SORTBY(colA,keys),
matchPos,XMATCH(keys1,sortkeys,1,2),
matchB,INDEX(SORTBY(colB,keys),matchPos),
IF(matchB=colB,INDEX(sortA,matchPos),NA()))
Then with OP's data you would need to check for On call vs. Break and calculate the difference, but would probably need a larger sample of data to model it realistically.
=INDEX(A3:A$7,MATCH(B2,B3:B$7,0))-A2