Prepare the vegetables and pork by trimming and cutting the beans into roughly 2-inch lengths, dicing the onion, mincing the garlic, chopping the bacon, and cubing the ham into ½-inch pieces. Evenly sized pieces help the beans soften consistently and distribute the smoky meat throughout the pot.
Set a heavy lidded pot over medium heat, cook the bacon and onion together for about 15 minutes with occasional stirring, then stir in the garlic for about 1 minute. Look for glassy onions and crisp bacon edges before adding the garlic, whose fragrance should rise quickly without turning acrid.
Dust the bacon-onion mixture with the flour and work it through the rendered fat for 1 to 2 minutes. The flour should lose its dry, powdery appearance and form a light coating rather than a dark roux.
Pour in the broth gradually while whisking, then loosen the golden-brown deposits from the bottom with a spoon. Those browned bits should dissolve into the liquid, leaving a smooth, savory foundation without dry flour pockets.
Fold in the beans, ham, basil, thyme, cayenne, and half the parsley, bring the liquid to a boil, then lower the heat and cook covered for 30 minutes, stirring occasionally. Gentle bubbling will soften the beans as their bright green color deepens toward olive green.
Remove the lid and maintain a gentle simmer for another 5 to 10 minutes, then mix in the remaining parsley and taste before adding Cajun seasoning or salt and pepper as needed. The finished sauce should look glossy and lightly coat the tender beans rather than run off like plain broth.
Portion the beans while warm, distributing the ham, bacon, and gravy evenly. Each spoonful should contain tender beans with enough sauce to coat them.