I have exactly the same issue on 5.0.10 with a byte[] (blob) of a child entity persisted through cascade from @OneToOne parent entity. If the lazy byte[] is not initialized before merge, you get the ClassCastException.