So, if nominee X is rejected then could the president simply hire X anyway but for a function that doesn't require Senate approval while de-facto X would do the same work?
What the law requires
Cabinet-level offices are established by statute. The existence of a Secretary and the need for Senate approval are also typically in the enabling statute. As an example, here's a section of the Department of Agriculture's enabling statute:
The Department of Agriculture shall be an executive department, under the supervision and control of a Secretary of Agriculture, who shall be appointed by the President, by and with the advice and consent of the Senate. [7 U.S. Code § 2202]
The Department must exist, it must be ran by the Secretary, and the Secretary must have Senate confirmation. If a President tried to have someone else run the Secretary, it would be unlawful.
Although the law says all of this, it is somewhat duplicative of the Appointments Clause of the Constitution:
[The President,] with the Advice and Consent of the Senate, shall appoint Ambassadors, other public Ministers and Consuls, Judges of the supreme Court, and all other Officers of the United States
The penalty for this crime would largely be a matter of politics - how far is the legislature willing to push? If the legislature determines it doesn't care, it might not amount to anything. On the other hand, willingly ignoring both the law, legislative intent, and the Constitution undoubtedly qualifies as impeachment material, should they want to pursue that.