The JPA spec specifically defines that certain EntityManagerFactory methods should throw an IllegalStateException when called on a closed EntityManagerFactory. After the 5.2 merge, not all of those checks are performed correctly.