The fn:ceiling function (and likely other related functions that do rounding-like operations) does not correctly work on xs:decimal's. For example:
results in 0.125. The expected value is 1.
Floats and doubles do round correctly, so a temporary work around is to cast any decimals that are passed into fn:ceiling to xs:doubles.
Note that commit a20ff4172807f5e0264ce68142f15f9798df1e8b changed the behavior of div to always return an xs:decimal instead of an xs:float/double, so any functions that try to fn:ceiling a division will likely run into this issue and require the xs:double cast as a workaround.