This is the function definition.
export async function getOrCreateAssociatedTokenAccount(
connection: Connection,
payer: Signer,
mint: PublicKey,
owner: PublicKey,
allowOwnerOffCurve = false,
commitment?: Commitment,
confirmOptions?: ConfirmOptions,
programId = TOKEN_PROGRAM_ID,
associatedTokenProgramId = ASSOCIATED_TOKEN_PROGRAM_ID
): Promise<Account>;
The fourth argument allowOwnerOffCurve
tells the library if the owner is a PDA or not, you are passing true means that the owner is a PDA, but your programId is onCurve
, hence it won't be able to get an associated token account for that owner
Change the true to false to get ATA of the program, if you intend to get ATA of a PDA, then change the owner to be a PDA, not a programId.