When trying to gain the trust of a summoned ocelot, it will immediately go into breed mode bypassing trusting. Occasionally a point towards trust might be added although I was not able to do that consistently.
Attempting to gain the trust of a summoned ocelot while it's in breeding mode will result in item desync where the client will think the fish was used while the server does not. (Related issue: MC-263594)
This does not appear to affect naturally spawned ocelots.
I cannot reproduce this on 1.20.6. Naturally spawned ocelots and ocelots summoned through commands/spawned in through spawn eggs both trusted me once I fed them enough fish.