If the ClassCastException occurs in the code of your XSLT processor then it's a bug and should be raised on the forum appropriate to the XSLT processor you are using.
Note however that your code is wrong, the $css_status variable is a document node containing a sequence of elements, you want
$css_status/i[@ref=$in_status]
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference