Do you have to file a US tax return if you sold Real Property even if you had a loss or you had sufficient withholdings?
Page 13 of the 1040NR instructions
"Dispositions of U.S. Real Property Interests Gain or loss on the disposition of a U.S. real property interest (see Pub. 519 for definition) is taxed as if the gain or loss were effectively connected with the conduct of a U.S. trade or business."
Page 8 of the same link says a tax return must be filed:
"You must file Form 1040NR if any of the following conditions apply to you. 1. You were a nonresident alien engaged in a trade or business in the United States during 2017. You must file even if: a. You have no income from a trade or business conducted in the United States, b. You have no U.S. source income, or c. Your income is exempt from U.S. tax under a tax treaty or any section of the Internal Revenue Code. However, if you have no gross income* for 2017, do not complete the schedules for Form 1040NR. Instead, attach a list of the kinds of exclusions you claim and the amount of each"