To replicate:
Place down an activator rail in an enclosed space, with an empty hive/nest next to it.
Set time to night, which should make bees enter the nearest hive as soon as possible.
Summon a minecart with a bee inside with
/summon minecart ~ ~ ~ {Passengers:[{id:bee}]}
above the activator rail.
The bee will be ejected from the minecart, but will not instantly enter the hive like it should. It may enter after an inconsistent and sometimes long period of time.
For intended behaviour:
Use a bee spawn egg next to a hive at night. The bee will instantly enter.
This bug is an issue in creating contraptions that move bees around.
May have duplicated this issue with bees in boats; transported bees over ocean, accidentally put them into the boat. After breaking the boat, the bees do not appear to be able to enter nests; they will still hover in the proximity of their intended hive, but do not enter.