@Adam Jaggers on the surface that strategy should work for you, but the first thing you will want to confirm with your tax professional is that the tax benefit you would receive from bonus depreciation will offset the gains you incurred.
Keep in mind, some property types will garner higher bonus depreciation than others. Bonus depreciation is derived from the portion of the property's value with a 15 year depreciation schedule (or less). Therefore the property types that are the most favorable to generate bonus depreciation will be those with a high degree of what the tax code refers to as "land improvements". Examples are mobile home parks, RV parks, and golf courses where the value of the property is not primarily derived from the building(s) but rather from the improvements to the land. In a mobile home park or RV park, most of the value is in the underground infrastructure, roads, landscaping, amenities, pools, fencing, pads, utility pedestals, etc, while only a small portion of the value comes from a building. In a similar fashion, if you can imagine how much landscaping and underground infrastructure is in a golf course as compared to the clubhouse, that will give an indication of why an extremely high percentage of the property's value is allocated to the land improvements.
When a property is purchased, a cost segregation study should be performed, wherein the value of the property will be segregated into land (which is not depreciated), buildings (which are depreciated on a 39 or 27.5 year schedule), land improvements (15 year schedule), and other smaller items like personal property. If the bonus election is taken, then 100% of the allocation to the "15 year or less items" can be taken as a passive loss in the year the property was purchased. Properly executed, an investment in these kinds of property can garner passive losses equal to or greater than the amount of capital invested.
This can be executed with a direct investment yourself, or with a passive investment in a syndication with a sponsor who is taking the bonus election. If you invest passively you will receive your pro rata allocation of bonus depreciation on your K1 along with the other investors. Either way, you should be able to garner passive losses equal to or greater than the amount of capital invested.
Those passive losses can be used to offset the gains you have incurred (or gains you expect to incur) as long as the gain AND the investment where bonus depreciation is being take occur in the same calendar year.
A few words of caution; be careful not to let the "tax tail" wag the dog. Each real estate type has different intrinsic performance characteristics, so make sure you understand the property type's risks and potential as an investment separate of the tax benefit. In other words, be careful not to invest in a poorly performing property simply for the depreciation. In that same vein, if you are investing passively in a syndication for bonus depreciation benefits make sure you vet the sponsor and understand the investment vehicle before you invest. Bonus depreciation is great, but when you combine that with great investment properties that produce cash flow and appreciation, that will be the best formula.
All the best,
Jack
PS - I am not a tax professional either, but surrounded by some good ones who assist us with this strategy on assets we acquire for our investment funds. I would also acknowledge @Yonah Weiss as he is an expert on this front and chimes bonus depreciation threads here on BP.