I have 2 identical feature classes, - one stored in FGDB and one in 'memory'. They both have 2 text fields, storing the same value in each row. Table for one of them:

When I run this from notepad:
aList = ['FC_ON_DISK','FC_IN_MEMORY']
for infc in aList:
arcpy.management.SelectLayerByAttribute(infc,"NEW_SELECTION","FieldA = FieldB",None)
nSelected = int(arcpy.management.GetCount(infc).getOutput(0))
print (f'Selection count = {nSelected} for {infc}')
I get these messages:
Selection count = 2530 for FC_ON_DISK
Selection count = 0 for FC_IN_MEMORY
The query on table stored in memory is not working from GUI either.
Is this intended behavior?