Your question should be Layoff irreplaceable?
Go with a mentality that company can anytime fire you, so it’s better to get a T shaped qualities which will help you in grabbing fastest and best opportunities in worse situations
Here a SWE or SDE or any technical role per se have a more weight, the numbers of engineers working for a particular product is more hence dependency is more , but in a stakeholder management job like PM, PO, Scrum Master they are 1 for the product but if product has nothing much to discover that person might get laid off
And lastly it’s purely on companies intent, market situation, politics in company that is being in that group which are influenced with higher roles
Hence a person needs to develop skill set which have higher or more number of volume of openings, and also create some products of own try to monitize and get more connections