This happens to me pretty often. If I haven't used my four-wheel drive for awhile, it seems to stick when I shift into 4hi on the fly. I've had everything from a loud clunk, to a spring "Boing" to the gears grind.
It is easiest to come to a complete stop before shifting, but that isn't always possible. I've found that slowing below 20 mph and not having my foot on the gas minimizes the "pain" of shifting into 4hi.