Avocados in my experience don't like being in a pot too long, it stunts them.
Another possible reason for shock when planting in the ground is lack of acclimatization period to new sunlight/climate conditions. If the plant you buy has been in shaded/protected greenhouse environment, and then you suddenly put them into bright sunlight and wind, that can cause the dieback of the plant. If i want to plant something right into the ground without hardening it off first, then i use a wire cage with shade cloth over it, and keep plants well moistened. This protects from sun, wind, and even critters.