The cause of this error is that the {@Day 10} formula is returning Zero which is not a value day-of-month.  Edit the formula so it looks like the following:

If {@Day 10} = 0 then "X" else
  Select Dayofweek(Date(val({?Pm-?Year}), val({?Pm-?Month}), abs({@Day 10})))
    Case  2:"M"
    Case 3:"T"
    Case 4:"W"
    Case 5:"TH"
    Case 6:"F"

This issue can also be caused by a leap year. In that case, it's recommended that you create a formula to test for a leap year and adjust the calculations as needed. An example of a formula to test for a leap year:

// Check if current year entered is a leap year
If toNumber({YEAR.EN_US}) Mod 4 = 0 and
  (
   toNumber({YEAR.EN_US}) Mod 100 <> 0 Or
   toNumber({YEAR.EN_US}) Mod 400 = 0
  )
then
  TRUE
else
  FALSE