So if we examine the rulings scholars have given for “betting” and what constitutes “betting,” it appears to me that this is a type of betting. Neither of them owns the gold, and so the money involved is purely for speculation. This is betting and so it’s haram.
Yes, if one is being paid to professionally speculate it’s fine. A company may hire an analyst to speculate future prices. This is permissible. But in the example you provided it’s betting.