AIX supports several alignment modes, which can be selected by pragma align specifiers: https://www.ibm.com/docs/en/openxl-c-and-cpp-aix/17.1.1?topic=pragmas-pragma-align
Default is "power" which uses 4-byte alignment for doubles which are not at the beginning of a struct. It is described here: https://www.ibm.com/docs/en/xl-c-and-cpp-aix/16.1?topic=data-using-alignment-modes
"natural" is recommended when compatibility with AIX libraries is not needed, which were built with the default setting.
The current FFI tests don't support the "power" mode. One option is to adapt these tests to use 4-byte alignment on AIX where needed.
Another option is to build the test libraries with "natural" specifier.