As seen in the image below, iterating and printing the instructions of a newly created function does not work, unless you sleep between creating the function and printing its instructions.

The code:
from binaryninja import BinaryView, Function, Platform
import time
# Create a binary view from a data buffer
new_bv: BinaryView = BinaryView.new("\x55\x55\x90\x90\xc3")
new_bv.platform = Platform["linux-x86_64"]
# Create a function at the start address
new_bv.create_user_function(0)
func: Function = new_bv.get_function_at(0)
time.sleep(0.1) # <--- remove me and the print below does not work
for instr in func.instructions:
print(instr)