I have no idea how this is problematic or what you have done to get into production problems.
Just reading the signature reveals all: here’s a list, “give me the single entry or null”. Common logic is all you need to come up with: if there’s anything else but one element in the list, you will get null, otherwise you get the element as seen by the return type.