Onions are supposedly toxic after cutting if you don't refrigerate them in a sealed container because the onions are supposed to attract bacteria.
I've never gotten sick from an onion being cut and left out on the counter overnight though as sometimes I would cut an onion and use part of it to make a sandwich or put on a hamburger and then forget to refrigerate the rest of the onion.
I'd then look at it the next day and it seemed fine so I continued to use the onion and have been doing that for many years now and never have gotten stick or had any stomach issues.
So maybe if you left the onion out longer than 24 hours after it's cut then it may become toxic but just overnight it shouldn't be a problem.
Refrigerating the cut onions in a sealed container will prevent bacteria from forming on the onions for up to 7 days.