Time out is fine but it does need to be used properly. The idea that the punishment has to be related to the "crime" can be counterproductive because it means you're constantly having to think up specific ideas in the moment and when you're feeling frustrated, irritated or angry then you're more likely to make the punishment more harsh, which is ineffective and comes with more downsides. If you can think up a related punishment in advance and it makes sense (e.g. aggression when coming off game = no game tomorrow) then that's fine and sometimes it's more effective than an unrelated thing. But for most things you don't necessarily need something that is related.
To use time out properly it means that you give a warning and then take the child calmly to the place - don't march or drag them there*. The warning could be specific or it could be a countdown.
No lectures or shouting, but do calmly explain why they are in time out in as few words as possible. Don't engage with attempts at conversation. Keep it short, no more than 1 min per year of age (consider halving this if child has ADHD). It's supposed to be boring, not overly shaming/humiliating so personally I'm not keen on names like naughty step/bench/chair etc but TBH this is probably a minor detail.
*Some sources recommend that you don't physically touch them at all, but if they don't comply with the time out, a different punishment is given such as removal of toy/privileges (again predecided). I find this a bit roundabout personally, and would just use the other punishment if you frequently have issues with time out. (DS2 I can't use time out with because it escalates into a meltdown, but DS3 it works fine).
Personally, I do not use time out to enforce demands that I make because I feel uncomfortable about this. (ie, I would not say "Put on your shoes/tidy up this thing or go in time out".) However, I will use it for things like physical aggression or behaviour that is destructive, and I find it much quicker at getting the point across than anything else.
The other major thing to understand about time out or any punishment at all really is that it will not directly teach anything. All it's doing is interrupting the behaviour and making it really clear what your line is. What actually changes behaviour is looking at the root cause, and support of the positive, replacement behaviour. Which might involve building skills, incentivising this behaviour, adding environmental support etc and the last one is the most important - looking at where you are now and where you ideally want them to be, and rather than expect them to transform their behaviour overnight, think up a path of steps from the current behaviour to the wanted behaviour, and look at how you can get them to the first step - and always make the steps smaller rather than increasing a punishment.
My DC are always horrendous behaviour wise when they need to poo. We started adding "sit on toilet for 5 mins" to the bedtime routine so they get at least 1x guaranteed good go of it once every 24 hours. But if it doesn't work at bedtime for you it might work better at a different time of day. Do see the GP if it is very bad though as he might be very constipated. Or perhaps first just try to get lots of fibre into his meals?
And DS3 (4.5) has been very worried recently about having bad dreams. We have been sprinkling pretend magic sand on him at bedtime to give him better dreams and it does help. See if you can work out why he's looking for reassurance/presence at bedtime and if you can address that, hopefully he'll stop the games and start to fall asleep earlier. Or would he go to sleep with you there? That's what I used to do for DS1, he fell asleep much quicker if I just stayed. He didn't need it forever.
TBH your description of his behaviour currently sounds very much like dysregulation in which case time out probably won't even help. You can't co-regulate your way out of the combo of insufficient sleep and physical discomfort caused by having a massive poo stored up. Sorting the poo thing almost definitely will help, trying not to give the behaviour too much attention, say no when you think it's a play at night time, and keeping him busy with challenges and other brain stimulation when you need him to cooperate with something.
My eldest also did not see his dad and had a lot of questions and wanted to talk a lot about families at that age. It is very normal and it's a good, healthy thing for him to be curious and want to process it. Remember that it's an adult idea that it's somehow "lesser" to not have a dad. To him he probably sees it no different to how some DC in the class have a sister and some don't, some children have a grandma and some don't, some children have a pet dog and some don't. If you have pictures of his dad and you feel comfortable, you could make him up his own little photo album he can look at, it can also help to get a book or a few about different family set ups. I think books are great for this age because it's hard for them to say or even conceptualise that they want to talk about things, but they can easily pick a book off a shelf at bedtime about something they want to talk about.
DS1 is 17 now and not having a dad has never been an issue for him at all. Yes he has a stepdad, but I honestly don't think it would have made a difference if he hadn't. Don't stress - this is a very normal age for difficult behaviour and it will get easier.