CoffeeBox's craft idea combines old coffee beans with candlelight, but placing dry beans, spices or peel near an open flame creates a different problem from choosing an appealing scent. Decorative combustible material can ignite. A short suggested burn time or a glass container does not establish that an improvised candle arrangement is safe.
Keep the visual idea and remove the flame. A small, stable decorative container of sound, dry beans can sit beside a separate battery-powered light, with both positioned where they cannot be knocked into a drink or reached easily by children and pets. Do not embed beans in candle wax, balance a burning tea light among them or add dried botanicals around a wick.
The arrangement is decoration, not a reliable room fragrance or sleep treatment. Beans that are moldy or otherwise compromised belong in appropriate waste disposal rather than a craft project, and a display should not be returned to the food supply. If a coffee-scented candle is the goal, choose a product made and labeled for that use and follow its own instructions instead of improvising fuel and container combinations.

The conversation
A good question can make a better brew.