Gold fossils come from Miraculous Fossil Rocks.
Those rocks can turn up at any Fossil Park, but they are genuinely rare. On your sonar they register as yellow dots — except that yellow dots also indicate ordinary Fossil Rocks, Dark Fossil Rocks, and Wonderous Fossil Rocks, so a yellow reading tells you something valuable might be there rather than confirming it.
The practical consequence is that you dig a lot of ordinary rocks while hunting for one. Cleaning them carefully matters too, since a gold fossil is easy to damage.