"And in Your book they all were written, The days fashioned for me," N.K.J.V.
If David believed some of his days had been fashioned by God, he might, I suggest, have not included the day when "Then David sent messengers, and took her." 2 Samuel 11:2.
If David believed all his days were fashioned by God he would include that day.
If on a certain days God withdrew His grace to resist temptation, from David's life, so that David would be confronted by his sinful nature and thus in time be humbled, might this not as much as a day of forgiveness, be part of God's teaching programme or fashioning?
[Sometimes caring teachers give their pupils work where the pupil is certain to fail in order to correct their over-confidence that they can always and easily get things right. Educational psychologists have referred to 15% failure rate as best for optimum learning. "for One is your Teacher, the Christ". Mat 23:10].
In Psalm 139:16 is David saying that:
absolutely all his days were fashioned by God and written in His book. or,
all the days fashioned by God are written in His book. [Leaving room for some days to be not fashioned by God]?
I have tried here to make a case for 1 and 2 both being valid alternatives because the N.K.J.V. leaves, I think, some wriggle room for interpretation. So, does the Hebrew clearly endorse 1 or 2?