NOT A TEACHER
He said it that it could have been wrong.
Supposing that the function of 'could have' here cannot be replaced with 'was able to' since the verb has an epistemic function (I think), we know that the original direct version was - as you wrote:
He said: 'It could be wrong'.
I am convinced that we do not transform the 'preterite' modal verbs when indirect (reported) speech occurs.
That is why I do not think that your first sentence is correct.
The latter, however, seems fine to me.
I might be wrong (I do apologise in advance in that case ) so I hope teachers explain better and are more concise than me.