Here is a slight variation that tries to take into account the working of the spell in a way that deals with the air displacement, the requirements are:
- The spell consumes momentum of whatever it teleports (see OP's edit, I accidentally wasted a lot of my time describing what the cube's motion might look like if the spell optimizes the teleportation process).
- The spell actually produces a cube of gold for at least an infinitesimal amount of time, in a non-gaseous form
- The spell is designed to avoid instantly killing the witch/wizard that casts it. Let's say the witch/wizard was wise enough to take these two precautions:
- the radius of effect of the spell excludes a protective shell around the witch/wizard's body just in case gold is involved in any biological process. (side note: is it? I don't suspect it, but one is never too sure).
- when it breaks a chemical bond, it teleports as many electrons as needed to keep the gold atom neutral, i.e. 79. The total polarization of every single gold atoms in the solar system might not be perfectly zero. Given the amount of gold, a slight variations might result in a major thunderstorm, but that also gets too impredictible to my taste.
I will assume the spell works like this:
- Locate all gold atoms in the radius of effect of the spell. Exclude any gold atom that might be present in the witch/wizard's body.
- Sort the atoms by distance from the witch/wizard
- Teleport the first atom where the wizard demanded
- Teleport the next atom to a position randomly chosen in the vicinity of the cube's forming surface, excluding the face touching the ground. Any atom's momentum is consumed in the process, but the relative electron/nucleus momentum is maintained.
- Wait for a small time interval $dt$, then repeat steps 2,4,5 until atom list is exhausted or spell caster is dead.
This will result in the gold atoms in the ground just beneath the spell caster to be teleported first, forming a small ball of gold that first crystallizes to a cubic arrangement, as this is the preferred lattice structure of gold.
All atoms would then gently attach to the surface and conform to the cubic lattice already in place. Therefore each face of the cube would expand by 1 atom per 5 $dt$ on average, leading to a cube of side:
$$L(t) = a\times \left(\frac{t}{5~dt}\right)^{1/3}$$
where $a$ is of the order of $10^{-10}$ m. The important point is that because of this power 1/3, the perceived velocity of the face by the witch/wizard gets smaller and smaller.
Let us just assume that $dt$ is chosen (perhaps automatically adjusted over time, letting $dt = f(t)$) such that this expansion pushes the air and everything else around "gently", effectively a quasi-static push, raising the radius of the atmosphere a bit.
Now in the vicinity of the spell caster, there might be plenty of gold available, producing a giant cube of gold similar to what the witch/wizard was expecting. Since gold is generally found in alloys, these would shrink progressively, but it gets more interesting as gradually the spell starts tapping into Gold(III) chloride in the oceans. Leaving unbound Cl atoms everywhere. Now, gold is particularly un-reactive, which is part of why it is so valuable and therefore why the spell was cast in the first place. In contrast, Cl is VERY reactive. Although the Cl atoms are neutral immediately after bound breaking, they will react with any organic substance they will find in the ocean. A significant part of it might simply form Cl2 gas, that should quickly start its rise to the surface.
According to Wikipedia, ClAu3 is present in the ocean in concentration of the order of $10^{−8}$ g/cm$^3$. However that can't possibly be the average concentration as it is waaaay too high if you multiply it with the gigantic volume of the oceans (that would be of the order of gigatons of gold if my calculations are correct). Nevertheless, my guess would be that this represents a huge amount of gas. Here is a translated quote from the French wikipedia entry for Cl2:
[Cl2] has a very unpleasant suffocating smell and is extremely toxic because it combines with mucous and lungs' humidity to form acids that attack tissues
Cl2 is much denser than air but much lighter than water. Therefore it will erect from the ocean and creep at Earth surface, intoxicating everyone that leaves close enough from sea level.
It's difficult to say wether this would kill all humans because I don't have access to the total amount of Cl released in this way. If it is small enough it might form a thin layer at sea level? But how thin exactly I could not tell.
Cl2 should be consumed fast though, since it can react with pretty much anything present on Earth's surface. So again it all boils down to how much amount comes out...
It's also quite likely that a large fraction of Cl will react with organic compounds in the ocean way before it reaches the surface, leading to pollutions of some other form. In any case, polluting the whole fricking ocean in just one day would certainly have nasty effects on sea life and climate, with inevitable consequences for us.
All the while, gold escapes all electronic devices of the Earth (we neglect dentistry devices). Now this is not as violent as you might expect, because it goes out atom by atom, reducing very gently its conductivity to zero, bringing the devices to open-circuit conditions. Therefore I do not expect much electrical hazard. The main problems would come from the engine in which they are embedded. As all computers in the world gradually shut down, the commands of engines, planes, trains, boats, stop responding. Planes would certainly crash, as their controls, sensors and communication to the outside all shut down.
I don't know how much electronics are involved in trains but they do have an emergency brake that is purely mechanical (at least in France), so driver might be able to save lives. Automatic track orientation might fail too. Satellites in the area start failing too. Solar cells all stop producing any of the current that no device is consuming anymore anyway.
More importantly, a number of hospital devices cease to function. In general, numerous hazards could be expected from the lack of control over virtually any machine that has an electronic interface. Those in motion come to rest in whatever way. Perhaps gently in a number of cases.
At this stage, the news have been broadcasting on every channel about strange reports of failing engines, car crashes, and fail to report unusual Cl2 levels over the ocean, as this would seem irrelevant in comparison to the much more visual effects of electronics. One by one though, all radios and TVs stop to deliver those news. Fewer and fewer people manage to reach their loved ones by phone or facebook.
At this point, a number of people would perhaps panic slightly.
Those who take their cars to flee find themselves stuck in massive traffic jams that are not regulated by any traffic light. It gets worse as more and more of these cars stop functionning properly in the middle of the road. Added to the overall nervosity, I guess the risks of car crashes is huge.
People in the countryside would probably be slightly less affected but are out of power too, meaning all the refrigerated food is doomed. Those who will survive till the end of this spell could experience some difficulty to feed themselves.
Assuming the cube has reached the point where it has accumulated all the gold from Earth, it starts tapping in the sun, and the witch/wizard starts to back down as it gets clearer and clearer that the cube's advancing front is going to crush anything on its way. Again, there is freedom in $dt$ so running might be unecessary, but the cube is going to be 470 km long ultimately. Out of any transportation mean (the locals have used any animal they could possibly find to carry them as far as possible), the witch/wizard eventually gets exhausted and falls.
The cube rolls over them, breaking loop (5).