An inconsistent starter motor that occasionally works perfectly now will not work. Then engine will not crank at all.

-got a second hand engine installed
– car return in great working condition absolutely no issues started instantly.
-never any prior issues with starting car, car started instantly 100% of the time prior to second hand engine install
A day after receiving the car the started motor refused to work not cranking at all after working fine after driving it a few times.
– the car worked post issues of not starting for my mechanic
-mechanic now says it needs a new starter motor and is an issue totally foreign to The install of the new engine just days prior.

is it possible for a starter motor to

– An inconsistent starter motor that occasionally works perfectly now will not work. Then engine will not crank at all.