Check out the hibernate.jpa.compliance.proxy configuration property for more details about this behavior.
For performance reasons, you want Hibernate to work just like in 5.3 which is how it’s been for many years, even before 5.2. The “Java Persistence with Hibernate” might be wrong about that since it was first written in 2005 and probably that paragraph was not updated.
I don’t think that 5.2 behaved like how you describe because the JPA compliance mode is false by default.