Shouldn't this be possible as the return value will be known when the receipt is created?
If you have a function which does not need the blockchain (or EVM) to get the return value, then you can get it directly. Such functions are
pure functions. Those functions get the value from your own node and there's no need to go through the EVM.
If the function is not
view, then it will go through EVM execution - it has to be mined in a block. Therefore the execution is not instant and you can only get the return value after the transaction is mined in a block.