This Used To Be Bugged, But A Patch Made It Bugged In A Good Way!
You Can Either Build A Shelter On Your Raft, And Exclusively Sleep On It.
Or You Can Get The "Paleo Diet" Achievement, Which Awards You With Both!
You Do Not Have To Do This 40 Days In A Row If You're Using The Raft Shelter Strategy, It Is Cumulative Over Your Entire Playthrough.
So You Could Do 2 Days, Sleep In A Shelter On The Third, Then Do The Next 38 Days At Any Point In The Current Playthrough.
Good Luck!