The bank knows but they maintain the fiction that they don't because their books collapse too if they count those. Banks make money from loans.
Don't forget this is typically a short term things. When the economy improves the building will be rented again. So they need the books to look good today to get through.