Mortgages often contain language stipulating that anything "attached" to the building becomes part of the building, meaning that it is collateralized under the mortgage. This is commonly known as "leasehold improvement" (rooftop central AC is one example) and is universal. Naturally, any bank will try to tie up everything you own under any circumstances, since it is after all what they do—you cannot blame them any more than you can blame a snake for eating a baby bird. However, all machine lease/purchase agreements contain language prohibiting the buyer from allowing the equipment to be thus collateralized. Note, prohibiting the buyer from allowing.
That means the buyer must ensure that language is inserted into the mortgage specifically excluding machinery or equipment that may be incidentally attached to the structure through electrical wiring, compressed air lines, and/or bolting to the slab. If you fail to do that, shame on you. The machine leasing company comes after you for the machines and so does the mortgage company.