Yes, it is a voluntary benefit but once you defer money into the plan it becomes subject to the plan rules, which are governed by federal law. Your 401k plan is a highly regulated retirement plan not a savings account. Your plan obviously limits your ability to loan or withdraw funds in your account. These limitations are governed by law and often are mandated by the same law.
I understand that does not help your current economic problem.