I think it is also possible to say this way:
"what you ought to do is to call the police".
The second sentence of yours sounds weird.
Maybe you can change a bit for the first sentence:
"what you ought to have done is to call the police".
- For Teachers