I have a planted and soiled 1.5 gallon, its been running for a month. Never had any bubbles, algae or anything.
The most important thing is don't use too much soil and avoid heavy layers of sand/tiny gravel on top of it as it just smothers the soil.
For a 5 gallon, you don't need 2 inches. That is more then necessary. Really 1/2 inch is plenty. Remember that your 5 gallon is confined, all the nutrients/stuff inside your soil is not going to be leaving, too much soil just leads to algae blooms. More soil doesn't mean your plants grow faster, your plants have limits to how much it will use up. Instead of black sand, I think you should try for a thin layer of gravel or small river rocks, just enough to keep the soil in place but allow oxygen to get in easily. If some of the dirt lifts and drifts in the water, its okay, it settles down within 24 hrs and use mesh to remove any floaters.
You can also mix your soil with some craft clay to help stabilize it, I never did since my tank is so puny.
When you first setting it up, after you add your soil, add some water that is just barely submerging the soil. Let it stay that way for about a day or two, after that add your plants + gravel/river rocks on top. Than fill the tank, remove debris.
I recommend you get some fast growing plants like dwarf hydro, guppy grass or hornwort, they will help prevent algae blooms and use up any seeping ammonia in the soil. I have all 3 in my 1.5 gal.