If you use the short expression form of a function, the inferred result type of the expression determines the function return type. If that is a platform type from Java, it could be nullable. If it is a Kotlin type then it will know the correct nullability.

But since you use the safe operator ?. you are saying for sure it could be nullable. And if the result is null or Unit then that gives the inferred result type of Unit?

Which is odd, but is exactly what you are saying. Therefore, either use a normal function body with { .. } or give the function an explicit return type if possible.

fun showProgressView(): Unit { ultraRecyclerView?.showProgressBar() }

You can also erase the nullability, by creating an extension function on Unit? :

fun Unit?.void() = Unit

And use it whenever you want to fix the return type: