From
Crinrict's Sims 4 Help Blog:
This cheat removes all moodlets the animal currently has.
Warning! Don’t use this when your dog is pregnant.
Open the cheat console with ctl-shift-c
Type testingcheats on
Type sims.get_sim_id_by_name
, to get the ID of the pet
Write down the ID. It’s a long one.
Type sims.remove_all_buffs (ID is the number you wrote down)
Close the console with ctl-shift-c
6/27/2018 ETA: the buff cheats (add or remove) are currently unavailable, but @luthienrising advises that you can use TwistedMexi's "get your cheats back" mod (no payment required). That should allow you to remove your pets' needy/scared buffs as needed until this bug is fixed! (Fingers crossed, heh!) :)
Luthienrising, sorry for spamming you with @'s! ;)