Accidents outside the box usually have a reason. Number and placement of boxes, litter, cleaning, plus high perches and hiding spots.
Cats naturally eliminate in a chosen spot and cover it, so many use a litter box without being taught. If a cat suddenly goes on the bed or floor, it is probably not being stubborn; something is likely bothering it.