Delay before LocalState seen by indexer

I’ve got a smart contract that writes a value into local state:
App.localPut(Txn.accounts[2], Bytes("AppTag"), Txn.application_args[1]),

(for an account that is supplied but not the caller)

I then call (Java):

to retrieve the local state. The key/value isn’t there - if I back off 5s and call searchForAccounts again, it is.
Is this expected behaviour?

Yes , this delay seems to be reasonable.
By sending a transaction, you just informing the blockchain that you want to have it “registeted” onto a block. It takes 1-2 rounds for the transaction to be accepted. The indexer only attempts to process accepted blocks , hence , the delay you’ve observed makes sense.