There are several possible reasons why a cat might poop inappropriately:

The litter box is too dirty: The owner can change the cat litter and clean the litter box.
If your cat is frightened or its environment changes: It is recommended that you patiently comfort your cat to relieve its anxiety.
If your cat is sick, such as with parasites or gastrointestinal diseases, it is recommended to take your cat to a veterinary hospital for examination and treatment as soon as possible.
Improper litter box location: It is recommended to place the litter box in a well-ventilated, quiet, and secluded place.
The cat hasn't recognized the location of the litter box: It is recommended to place the cat's feces in the litter box, let it smell it, bury it, and let it get used to the litter box.