1 NOW it came to pass, as David sat in his house, that David said to Nathan the prophet, Lo, I dwell in an house of cedars, but the ark of the covenant of the LORD remaineth under curtains.Here David wants to build a temple, and the Lord's prophet, Nathan, approves of the idea and says that God is with David in terms of the proposed plan. The Lord is actually against the proposal, and intervenes with a revelation to Nathan to correct the matter. As a result, the prophet has to make a retraction, contradicting his previous position in light of subsequent revelation from the Lord.
2 Then Nathan said unto David, Do all that is in thine heart; for God is with thee.
3 And it came to pass the same night, that the word of God came to Nathan, saying,
4 Go and tell David my servant, Thus saith the LORD, Thou shalt not build me an house to dwell in.
What we see here is an authorized prophet acting in good faith, but acting as a human being (an authorized and anointedd one - that's a key difference). He can make decisions and statements that prove to be incorrect or need to be changed by later actions from the Lord. It's all par for the course. No reason to reject Nathan as a prophet or get all bent out of shape about all the changes that have been made. Rather, we should rejoice that the Lord did have (and now does have) a means to reveal His will and correct problems that may arise.