If somebody sells x amount of BTC (or any other crypto) mistakenly at 4k instead of the current 40k (assumption), who will get it and for how much? Will somebody just be the happy one?
TLDR: The highest bidder on the exchange will get it.
One of the main jobs of an exchange is to match sellers with buyers. The exchange will help users sell for the highest price possible, and buy for the lowest price possible. If the price you want is lower than the highest bidder (buyer), the exchange will tell the buyer, "hey, we found someone that wants to sell you bitcoin at your price!". The buyer does not know that you were willing to sell for 4000.
Noone will be lucky. All reputable exchanges have several people wanting to buy at a price higher than 4000 when the current price is 40 000.
You can figure out the price you're going going to sell for if you take a look in the orderbook. There you can see people wanting to both buy and sell bitcoin for different prices. In the picture, green orders are buyers, and red orders are sellers. The price you're going to get when you sell bitcoin is the top green one.
You can try it for yourself! Add a limit sell order with 4000 as the price. Depending on the exchange it will tell you that by placing the order, 100% of the order will be filled. The final price is not going to be 4000, but probably very close to 33 828.
AFAIK, if it is the same as stocks, then it is "The person who entered it first", meaning:
If somebody put in the limit order to Buy At $33,000, before you, then your $4000 will be matched to his limit order, but because he entered it first, then the transaction between you and him will be $33,000. That's the rule.
There are tons of buy orders to buy at $33,000 or $32,999, so the $4000 will be matched by those numbers first. (and it will be sold at $33,000 or whatever the highest bidder is).