Using hard disk after a S.M.A.R.T. error Good day everyone. I had an hard drive and start giving a S.M.A.R.T error and I've immediately replaced it. Now if I try to format it in exFAT, all goes right, (also checkdisk). Here is the result

But if I try to format in APFS or in MacOS Extended, it gives me following error:
APFS:

MacOS Extended:


I would like to know if it's safe if I continue using this hard disk (for example as an external one). If not, why does exFAT say  it's all right?
I would like to know if it's safe if I continue using this hard disk
  (for example as an external one). If not, why exFAT says all is right?


No, it is not safe and exFAT is not saying it's all right.  Disk Utility is just not telling you that's something's wrong when it writes the exFAT partition.

A S.M.A.R.T. error is an error that is generated by the drive itself (not macOS) and this cannot be overridden by a format type (exFAT, APFS, HFS+, etc.)  The reason one format generates an error and another doesn't has to do (basicailly) where the partition is actually written to the physical disk.  With exFAT, that "bad" area isn't being written to, thus, no error.

Bottom line, the drive is proven to be failing; I wouldn't continue to use it.