Hi and welcome to Just Answer!
Because distribution is not used to pay qualified education expenses - it is partly taxable.
However - you will be taxed only on earnings.
Your original contributions are distributed tax free.
Your taxable income is reported on form 1099Q Box 2 Earnings which based on your information = $40,000.
The taxable amount must be reported on Form 1040 line 21.
Generally, if you receive a taxable distribution, you also must pay a 10% additional tax on the amount included in income - which is reported on Form 1040 line 58 (use Part II of Form 5329 to figure any additional tax).
If you think that the actual cost basis and earnings are reported incorrectly - you need to contact the payer - provide your arguments and ask for correction. Mistakes do happens sometimes.
So far based on your information - yes - you need to include $40,000 in your taxable income and pay additional 10% penalty.
Sorry if you expected a different answer.
Please be sure top ask for clarification if needed.