Can player floop Ancient Scholar when no Rainbow cards in their discard pile?
Yes, player can FLOOP Ancient Scholar even if there is no Rainbow cards in their discard pile
In this case they fail to return a random Rainbow card to their hand, but still can gain 1 Action (if control a building in the lane). This is explained in detail by Matt Hyra at boardgamegeek.com forum: Flooping without fulfilling ability?
According to the explanation, the general rule is

you may always Floop if the ability doesn't target anything. If it requires a target, you must have a legal target before you can Floop