I was facing the same issue in one of my projects recently. In my case the client wanted to display stock availability label (i.e. Instock/Outofstock) on category pages as well. That is not available in default magento.
When saleable qty becomes 0 and quantity is 1 in that case PDP page was showing outofstock where the category page was still showing in stock having the same code written over both places. However, the fact was that the customer could not able to add that product into cart at the end. Hence, it was creating chaos on customer's mind.
What I did was to modify magento default code a little bit as below:
Old Code :
<?php if ($block->displayProductStockStatus()) :?>
<?php if ($_product->isAvailable()) :?>
<div class="stock available" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>">
<span><?= $block->escapeHtml(__('In stock')) ?></span>
</div>
<?php else :?>
<div class="stock unavailable" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>">
<span><?= $block->escapeHtml(__('Out of stock')) ?></span>
</div>
<?php endif; ?>
<?php endif; ?>
New Code :
<?PHP
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$stockState = $objectManager->get('\Magento\InventorySalesApi\Api\GetProductSalableQtyInterface');
$saleQty = $stockState->execute($_product->getSku(), 1);
?>
<?php if ($block->displayProductStockStatus()) :?>
<?php if ($_product->isAvailable() && $saleQty > 0) :?>
<div class="stock available" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>">
<span><?= $block->escapeHtml(__('In stock')) ?></span>
</div>
<?php else :?>
<div class="stock unavailable" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>">
<span><?= $block->escapeHtml(__('Out of stock')) ?></span>
</div>
<?php endif; ?>
<?php endif; ?>
Hope this help you.
Thanks,