The treasure tables are a tool to supplement a DM's choices, not a limitation on what kinds of treasures exist in the game reality. You are also not required to randomly determine treasure — you can place whatever treasures you, the DM, want to:
The following pages contain tables that you can use to randomly generate treasures carried by monsters, tashed in their lairs, or otherwise hidden away. The placement of treasure is left to your discretion. (DMG, p. 133)
If a treasure hoard includes gemstones, you can use the following tables to randomly determine the kind of gemstones found, based on their value. (DMG, p. 134)
Tools, not rules
Random determination is not an obligation. You can set the treasure by yourself based on what you think it should be.
Even when you use the tables, they are a tool, not ironclad rules that you must obey. You can even use the tables to generate a total value, if you wanted to get a guideline, and then make up an approximate treasure to suit — you don't have to stick slavishly to the precise objects generated. For example, you could decide that a treasure is “two chests of iron ingots worth 3,560gp on the open market and a promissory note from the Merchant's Guild redeemable for 700gp” instead of “coins: 600cp, 9000sp, 2600gp; gems: 100gp pearls ×7”.
There are lots of different diamonds
The reason to point all this out is to counter the assumption in the question that every diamond is a 5000gp stone, and that the only diamonds that exist are 5000gp diamonds.
Other diamonds can — indeed, should — exist in your campaign's world because diamonds come in all sizes and grades and the DM's job is to create an interesting and plausible world for the player's characters to live and adventure in. The random tables, mistaken as ironclad rules, would give your players a world where factory-identical 5000gp diamonds popped out of the ground, fully-cut, and never could they be recut, chipped, powdered, or otherwise devalued. That's not a piece of worldbuilding that makes any sense when the players start interacting with it.
So the spell calls for a 300gp diamond because there are other diamonds. Maybe you don't have the time and inclination to place any treasures other than randomly-generated ones straight from the book (which is fine!), but other diamonds still exist. The PCs can go to a jeweler's and buy a 300gp diamond; they can prise three matching 100gp diamonds out of the royal crown; they can take that treasure table 5000gp diamond to a jeweler to have it recut into smaller stones each worth 300gp; they can cut it themselves with the right tools and proficiency; they can go buy a few 300gp pouches of teeny 10gp diamonds that they can use for paying for inn rooms or consuming as spell components. Treasure hoards are not the only place valuable objects exist or can come from.