Does macos need special configurations?

I copied the pass that I wrote on my ubuntu machine on my new macbook pro 16, but I’m getting this error:
Assertion failed: (getTypeID() == ArrayTyID), function getArrayElementType, file /Users/ooqed/llvm-project/llvm/include/llvm/IR/Type.h, line 376.

on this line of code:
Type *myarr = AI->getType()->getArrayElementType();
Is this normal? how can I fix this?

ps the problem seems to be the call getArrayElementType, but I can’t understand why, maybe I’m missing some things on macos?

I’d try to debug what is AI->getType() with something like AI->getType()->dump().