What happens to Fed's balance sheet when its asset shrink in value?
When the Fed issues say 100k in liabilities (paper dollars) to buy 100k in assets (t-bills), then they will at the end of the year take their revenue from their assets, subtract their expenses and remit the profits to congress.  This is an obscure process but it does exist.  If you see a congressional budget, you'll see an item marked as miscellaneous revenue...this is a portion of if that.  Now they do not remit as much as they should but that is another story.

If the Fed had to write off say 50k in bad debt, then that would count against their income for their year (and mean they earned 50k less).  The 50k would actually be debited away from equity and not liabilities.

The Fed (that I know of), does not issue money directly to itself nor the treasury.  It can create money to buy investments...and then spend the profits from investments on their own expenses.  It can also sell equities for a profit (rarely done) to boost their equity.

A good question is what would happen if the Fed had to write off more in assets than they had in equity.  I doubt they would shrink the monetary base to balance the books, but instead would fabricate an asset to keep the illusion going (like say a 'good will from the treasury').