Took a look at the screenshot and the debug logs. It is expected
At line 452 you are not populating ownerIds, you have just defined the set
Set<String> ownerIds = new Set<String>();
However, at line 458 you have populated the ownerIds
ownerIds.add(sts.OwnerId);
Let me know if this helps, if it does, please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Took a look at the screenshot and the debug logs. It is expected
At line 452 you are not populating ownerIds, you have just defined the set
However, at line 458 you have populated the ownerIds
Let me know if this helps, if it does, please mark this answer as best so that others facing the same issue will find this information useful. Thank you