If you are a self-employed nonresident alien living in the United States, the information below will help determine whether or not you are subject to self-employment tax. If you are not, yet the tax is calculating on your return, the navigation steps below will allow you to stop that from calculating.
Per the IRS Instructions for Form 1040-NR U.S. Nonresident Alien Income Tax Return, page 4:
Self-employment tax.You must pay self-employment tax on your self-employment income if an international social security agreement in effect between your country of tax residence and the United States provides that you are covered under the U.S. social security system. Enter the tax on line 55. See the instructions for line 55 for additional information. Enter the deductible part of your self-employment tax on line 27. Attach Schedule SE (Form 1040 or 1040-SR). See the Instructions for Schedule SE (Form 1040 or 1040-SR) for additional information.
Per page 38 of the instructions:
If you are a self-employed nonresident alien, you must pay self-employment tax only if an international social security agreement (often called a totalization agreement) in effect determines that you are covered under the U.S. social security system. See the Instructions for Schedule SE (Form 1040 or 1040-SR) for information about international social security agreements. Information about totalization agreements is available at IRS.gov. Enter "totalization agreement" in the search box. You can also find information at www.SSA.gov/international/ under “International Agreements.”
CAUTION! If you are not required to pay self-employment tax but do so anyway, you will not be eligible to receive social security benefits.
If you have self-employment income that is exempt from Self-Employment Tax, follow these instructions to stop that calculation on the return:
Desktop users can also access the Schedule SE - Adjustments - Self-Employment Adjustment Worksheet in the Worksheets section of the Forms list to check the box in the Nonresident Alien filing Form 1040-NR: section at the top of the form.