Looking at the source code mentioned in the stack trace, I see
this at liquibase.diff.output.changelog.core.MissingForeignKeyChangeGenerator.fixMissing(MissingForeignKeyChangeGenerator.java:43)
change.setReferencedTableName(fk.getPrimaryKeyTable().getName());
The 'change' object is created in that method, so it cannot be
null. The 'fk' object mentioned in that line is used in the line
before, so it is also not null. That leaves just
fk.getPrimaryKeyTable() as the possible null pointer.
If I had to guess, I would say that somewhere in the database you
are trying to generate a changelog for there is a foreign key that
refers to a table that is not in the current schema or that the user
connecting to the database does not have permissions for. But that
is just a guess.