You’re mixing up arrays. In your “my implode”, $checkedBundeslaenderList
varies between a string and an array, depending on the number of items.
And then in your query args, you nest it in an array:
'terms' => array( $checkedBundeslaenderList ),
So what you could end up with is either:
array( array( 1 ) );
…or:
array( '1,2,3,4' );
Neither are valid formats. Instead, always use an array:
if ( ! empty( $_POST['checkedBundeslaender'] ) ) {
$checkedBundeslaenderList = wp_unslash( ( array ) $_POST['checkedBundeslaender'] );
} else {
$checkedBundeslaenderList = array();
}
And then just pass it straight to your query:
'terms' => $checkedBundeslaenderList,