Retrieving entry just after saving it returns null
Searching for an Element by Title, as you describe, is potentially problematic as the Title is not required to be unique. But may not even be necessary in your case.
The $entry object that you pass to the craft\services\elements::saveElement() method will get updated in the same scope that you are running the saveElement code. It appears that you are already accessing that same $entry object when you are using it to throw errors.
See the Objects and References page in the PHP docs for a discussion of the behavior.
Here's a rough update of your code per that expectation:
$entry = new Entry([stuff here]);
$entry-&gt;title = 'foo';

if (!Craft::$app-&gt;elements-&gt;saveElement($entry)) {
  dd($entry-&gt;getErrors());
}

// No need to query, you can already access the Entry you just saved
$entry-&gt;title

// If you need to query, you could do so via the ID 
// from the Entry Element object you just saved:
$entry = Craft::$app-&gt;elements-&gt;getElementById($entry-&gt;id);
$entry-&gt;title

Is there a reason you need to query the Element again right after you save it?