I need to be on the bed to sleep instead of just being near it.
In bedrock you have to be extremely close to the bed, like on top of it for it to let you sleep. You can be a block away from it and it says the bed is too far away, the distance you are able to use a bed should be higher.