I found that using
import { useBlockProps, MediaPlaceholder } from '@wordpress/block-editor';
import { TextControl, __experimentalNumberControl as NumberControl } from '@wordpress/components';
instead of
import { TextControl, NumberControl, MediaPlaceholder } from '@wordpress/components';
resolved the problem.