Does "excuse" mean the same thing in these two sentences?

He's a sorry excuse of a doctor.

He had to get his mother to write an excuse for him.
different meanings