This seems to have been brought up and not solved for years, and the appropriate discussions are closed. But I have a bit to add. When configuring the budget, the selectable categories are:
Note that Capital Gains are not listed. Here's the relevant portion of the Category List:
This shows many more categories (including those for Capital Gains) than the Budget recognizes. IMHO, seems like an easy bug to fix. This must be really old, non-maintained code.